Bayesian Estimation of Negative Binomial Parameters with Applications to RNA-Seq Data

Extracted source text · arXiv 1512.00475

%\documentclass[letterpaper,11pt]{article}
\documentclass[11pt]{article}

%--------- PACKAGES -----------------------------------------------
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{natbib}
\usepackage{bm}
\usepackage[dvips]{graphicx}
\usepackage{longtable}
\usepackage{fullpage}
\usepackage{setspace}
 \usepackage{soul}
 \usepackage{multirow}
% makes double spaced lines
%\usepackage{todonotes}

\renewcommand{\baselinestretch}{1.4}
\newcommand{\iid}  {\stackrel{\rm iid}{\sim}}
%\renewcommand{\includegraphics}[2][this]{\vskip 2in}
% ***************************************************************
% marking changes..x
%
%\usepackage[usenames,dvipsnames]{color}
%\newcommand{\bchm}{\color{Orange}  }     %    ... in math environmt
%\newcommand{\ech}{\color{black}\rm  }    % end change
%\newcommand{\bch}{\color{blue}\em  }   % begin change
%\renewcommand{\ech}{\color{black}\rm  }    % end change
%\newcommand{\fq}{\color{OliveGreen}\em }
%\newcommand{\qf}{\color{black}\rm }
%\newcommand{\bchg}{\color{OliveGreen} \em }   % begin change by S
%\renewcommand{\ech}{\color{black} \rm  }    % end change
%\newcommand{\note}[1]{\color{blue}
%  (Note)\footnote{\color{blue}#1}\color{black}~ }
%\newcommand{\cut}{\color{Red}[cut] \color{black}  }
%% \newcommand{\split}{\color{Red}[split] \color{black}  }
% ***************************************************************
\newcommand{\but}[1]{\marginpar{\color{red}\begin{sffamily}#1\end{sffamily}\color{black}}}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}


%--------- newcommands  ---------------------------------------------------
\newcommand{\Nij}[1]{N_{i#1}}
\renewcommand{\b}{\beta}
\renewcommand{\a}{\alpha}
\renewcommand{\d}{\delta}
\newcommand{\g}{\gamma}


\newcommand{\ssq}{\hbox{$\sigma^2$}}
\newcommand{\tsq} {\hbox{$\tau^2     $}}
\newcommand{\sinv}{\hbox{$\frac{1}{\sigma^2}$}}
\newcommand{\tinv} {\hbox{$\frac{1}{\tau^2}     $}}
\newcommand{\trinv} {\hbox{$\frac{1}{\tau_r^2}     $}}
\newcommand{\tpinv} {\hbox{$\frac{1}{\tau_p^2}     $}}
%\newcommand{\st} {\hbox{$\frac{\sigma^2}{\tau^2}     $}}
\newcommand{\ts} {\hbox{$\frac{\tau^2}{\sigma^2}     $}}
\newcommand{\stp} {\hbox{$\frac{\sigma^2}{\tau_p^2}     $}}
\newcommand{\tsp} {\hbox{$\frac{\tau_p^2}{\sigma^2}     $}}
\newcommand{\ptsp} {\hbox{$p \frac{\tau_p^2}{\sigma^2}     $}}


\newcommand{\etal}{\textit {et. al.}}
\newcommand{\z}{\textbf{Z}}
\newcommand{\y}{\textbf{Y}}
\newcommand{\x}{\textbf{X}}
\newcommand{\xv}{\textbf{x}}
\newcommand{\kv}{{\bf k}}
\newcommand{\Hessian} {\textbf{H}_{\hat{\beta}}}
\newcommand{\Id}{\textbf{I}}
\newcommand{\ones}{\textbf{1}}
\newcommand{\dk}{\delta_{i}}
\newcommand{\muk}{\mu_{i}}

\newcommand{\Poi}{\mbox{Poi}}
\newcommand{\Ga}{\mbox{Ga}}
\newcommand{\DP}{\mbox{DP}}
\newcommand{\di}{\mbox{d$_i$}}
\newcommand{\dec}{\mbox{d}}
%\newcommand\plotpath[1] {../figures/#1}
%\newcommand\plotpath[1] {./figuresinpaper#1}
%\def\plotpath{/volumes/kingston32/work12/Students/Luis/NB/figures}
%\def\plotpath{/volumes/kingston32/work12/Students/Luis/NB/figures-new}
%\def\plotpath{/users/casella/worktransfer/NB/figures-new}
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}

%--------- TITLE ---------------------------------------------------
%\title{Negative Binomial Estimation}
%\author{Luis  Leon-Novelo}
%-------- BEGIN DOCUMENT --------------------------------------------
\begin{document}
\title{Bayesian Estimation of Negative Binomial Parameters\\ with Applications to RNA-Seq Data}
\author{Luis  Le\'on-Novelo\thanks{To whom correspondence should be addressed: 
Department of Biostatistics,
UTHealth School of Public Health, 
P.O. Box 20186 , Houston, TX 77225. Email:  \texttt{luis.g.leonnovelo@uth.tmc.edu}}\\
UT Health Science Center
\and
Claudio Fuentes\\
%\thanks{Assistant Professor, Department of of Statistics, Oregon State University, Corvallis, OR  97331.  Email:  \texttt{fuentesc@stat.oregonstate.edu}} \\
Oregon State University
\and
Sarah Emerson\\
%\thanks{Assistant Professor, Department of of Statistics, Oregon State University, Corvallis, OR  97331.  Email:  \texttt{emersosa@stat.oregonstate.edu}}\\
Oregon State University
}

\date{}
\maketitle
\begin{abstract}
RNA-Seq data characteristically exhibits large variances, which need to be appropriately accounted for in the model.  We first explore the effects of this variability on the maximum likelihood estimator (MLE) of the overdispersion parameter of the negative binomial distribution, and propose instead the use an estimator obtained via maximization of the marginal likelihood in a conjugate Bayesian framework. We show, via simulation studies, that the marginal MLE can better control this variation and produce a more stable and reliable estimator.  We then formulate a conjugate Bayesian hierarchical model, in which the estimate of overdispersion is a marginalized estimate and use this estimator to propose a Bayesian test to detect differentially expressed genes with RNA-Seq data. We use numerical studies to show that our much simpler approach is competitive with other negative binomial based procedures, and we use a real data set to illustrate the implementation and flexibility of the procedure.% both better than DESeq (Anders and Huber 2010) when the DESeq assumption is violated, and remains competitive when it is not.


%Based on a Bayesian hierarchical model\but{needs editing}, we derive an estimator for the overdispersion parameter of the negative binomial distribution and demonstrate via simulation that this estimator outperforms the MLE in terms of mean square error when the sample size is small.
%Based on this estimator we propose a Bayesian test to detect differentially expressed genes with RNA-Seq data.  We show that our approach is both better than DESeq (Anders and Huber 2010) when the DESeq assumption is violated, and remains competitive when it is not.
\end{abstract}

\bigskip
{\it Keywords}: Bayes estimation; Hierarchical models; Maximum likelihood estimation; Hypothesis testing; Negative binomial; RNA-Seq analysis; DEG.

\newpage
\section{Introduction}

The modeling of RNA-Seq data has proved to be problematic: the underlying mechanism resembles some kind of Bernoulli experiment, but the actual data typically exhibit overdispersion and other features that often prevent using simple models (such as the binomial) to perform the analysis. In this context, a nice introduction to the RNA-Seq technology and the statistical analysis leading to a Poisson model is given in \cite{salzman2011statistical}. 

Alternatives to the Poisson model have also been considered, including a normal approximation to the binomial \citep{Feng2010} and the beta-binomial generalized linear model \citep{zhou2011beta} among others.  However, the overdispersion problem still persists, motivating researchers to develop new approaches that can explicitly address this issue, such as the overdispersed Poisson model \citep{Auer:Doerge:2010} and the negative binomial model \citep{Robinson:Smyth:2008,Anders:Huber:2010, di2011nbp, graze2012allelic}, which we consider in this paper. %The latter seems to be the most appropriate for this type of data and motivates the work we present in this paper.

The negative binomial density  can be parametrized as %in terms of its mean $\mu$ and overdispersion parameter $\alpha$,
\begin{equation}\label{NB_density_alpha}
p(k\mid \alpha,\mu)=
%\frac{\Gamma(k+\alpha^{-1})}{k!\Gamma(\alpha^{-1})}
\frac{1}{{\cal B}(k+1,\a^{-1}) (k+\a^{-1})}
\left(\frac{\alpha\mu}{\alpha\mu+1}\right)^k
\left(\frac{1}{\alpha\mu+1}\right)^{1/\alpha}
,\quad k=0,1,\dots,
\end{equation}
where ${\cal B}(x,y)=\Gamma(x)\Gamma(y)/\Gamma(x+y)$ is the beta function and $\mu,\alpha\geq 0$. Under this parameterization $E(k)=\mu$ and $Var(k)=\mu+\alpha\mu^2$, and therefore the overdispersion is explicitly determined by the value of the parameter $\alpha$. Despite this natural advantage, the negative binomial model still presents some challenges. For instance, maximum likelihood estimation can be problematic, as it shares some of the same features with the binomial model. \cite{olkinm:petkau:videk1981} observed that two similar samples from a binomial distribution with success probability $p$ and sample size $n$ (both unknown), can lead to very different maximum likelihood estimators of the sample size.  To address this problem, \cite{carroll:lombard:1985} proposed estimating $n$ by  first integrating the likelihood  with respect to a beta distribution on $p$, and then obtaining an estimate of $n$ by maximizing this integrated likelihood. Applying the same idea to the negative-binomial distribution in the estimation of the overdispersion parameter $\alpha$, it can be found that such marginalization improves the properties of the estimates.  This result has a direct application in the estimation of the expression levels from RNA-Seq data, as the negative binomial distribution has become popular in the modeling of such data. %In the next section, we briefly discuss the problem of interest and review some of the existing literature.

%We propose\but{edit this paragraph} as estimator of $\a$, $\tilde{\a}$,  We show via simulations that $\tilde{\a}$ outperforms  $\hat{\a}$ in terms of mean squared error (MSE) in small samples. 

\subsection{Models for RNA-Seq data}\label{sec:RNA-Seq}

%Using the ideas above we propose  
%a Bayesian model based inference procedure to detect differentially expressed genes (DEG) in two populations (from now on referred to as treatments)
%from RNA-Seq like datasets.
%The structure of the data set is a table where the element in row $i$ and column $j$  is the  number of reads aligned to gene $i$ in the individual $j$.
%The number of individuals is $J_1+J_2$.
%The first $J_1$ columns represent the counts corresponding to the individuals under treatment 1 and the last $J_2$ to individuals 
%under treatment 2.
%The proposed  Bayesian model assumes \textit{a priori} that $\alpha$ is small. 

The general problem consists of detecting differentially expressed genes (DEG) in RNA-Seq data sets coming from two different populations, from now on referred as to \emph{treatments}. The data can be represented in a table whose entry $(i,j)$ corresponds to the RNA read counts aligning to gene $i$ in individual $j$. The set of reads originating from individual $j$ (the column of the table)  is referred as to the \emph{library} for individual $j$. The \emph{library size} or abundance $s_j$ for individual $j$, is a positive number proportional to the coverage or sampling depth of library $j$ and can be proportional to the total number of reads in (or the sum over) column $j$. However, this sum can be sometimes dominated by the counts of few highly expressed genes. In addition,  the read counts depend not only on the underlying mean expression level but also on the library size and therefore, any statistical analysis must appropriately account for (or adjust for) the difference in library sizes. %To address these issues, \cite{Anders:Huber:2010} introduced a robust estimate of the library size that we will use later. (See equation \eqref{libsize})

In this context, \cite{Robinson:Smyth:2008} propose a test for DEG  when only a few read counts per treatment are observed. %(a typical feature of RNA-Seq datasets). 
Their method assumes that the read counts are negative binomial and that the overdispersion parameter $\alpha$ is the same across the genes. More importantly, they propose a conditional test (similar in nature to the Fisher exact test) to detect  whether the counts associated with a given gene follow a negative binomial distribution with the same parameters under both treatments. 
The test assumes that $\alpha$ is known and conditions on the sum of all the counts (over both treatments) for gene $i$, considering different library sizes.  \cite{Robinson01112007} \citep[see also][]{chenetal:2014} relax the assumption of constant overdispersion and, for each gene, 
estimate a different $\alpha_i$ using an empirical Bayes procedure. In both cases, the estimated values of the overdispersion parameters are taken as the true value. The bioconductor package  \textit{edgeR} by \cite{Robinson01012010} implements both approaches.

\cite{Anders:Huber:2010} propose an alternative solution in their procedure DESeq. They also cosider a negative binomial distribution for the gene counts, but  assume that genes with similar mean counts have similar variances.  That is, if $\mu_i\approx \mu_j$, then $\a_i\approx \a_j$, where $\mu_i$ and $\a_i$ are the mean and overdispersion parameters of the negative binomial distribution for the counts of gene $i$. Specifically, they model the variances as a smooth function of the means and propose an unbiased estimator for the variance $\nu_i$ performing a local regression of $\nu_i$ on $\mu_i$. The adjusted $\nu_i$'s are treated as the variance true values.  Finally, for each gene, they test whether the counts have the same mean across the  two different treatments. In order to select differentially expressed genes, DESeq builds on the procedure proposed by \cite{Robinson:Smyth:2008}.

Instead, \cite{Auer:Doerge:2010} discuss the design of experiments targeting the identification of DEG using RNA-Seq data. They emphasize the importance of replication (having more than one individual per treatment), randomization and blocking.  For each gene separately, they  model the log-mean of the read counts as the sum of the log-library size and the treatment effect. That is, for gene $i$, they take $\log \mu_i=\log s_j+\tau_{i\ell}$, where $\tau_{i\ell}$ is the treatment effect for $\ell=1,2$.  In their approach, the library size $s_j$ for  individual $j$ represents its overall number of reads and is estimated before fitting the model and treated as known.  The treatment effect can be estimated through a Poisson regression with ``exposures'' $s_j$. Using the estimated means, they suggest a statistical test for DEG that considers the possible overdispersion of the data (with respect to the Poisson model), based on  the likelihood ratio test for the Poisson regression. Auer and Doerge (A\&D) also suggest a balanced block design (BBD) to control for lane and batch effects, and then include both batch and lane effects in the linear model for the log-mean. In order to make the means identifiable, in addition to biological replication, it is necessary to split or ``bar code'' each individual into the number of lanes of the sequencing machine. The same statistical test can be applied under the BBD. %In their approach, the library size for the individual $j$ represents its overall number of reads.

A different method is considered by \cite{hardcastle:kelly:2010} in their baySeq procedure. They also start from a negative binomial model, but then take a Bayesian approach. However, rather than using a Bayesian prior distribution for $\alpha$, they construct an estimated, data-dependent prior, using a combination of empirical Bayes, maximum likelihood, and quasi-likelihood. %Empirical evidence suggests that their procedure, baySeq, outperforms  DESeq. 
The baySeq method is implemented in the bioconductor package of the same name.

Alternatively \cite{wu2013new} propose a negative binomial Bayesian model with a log-normal prior for the overdispersion  parameter $\alpha$. Every gene is assumed to follow this model and the parameters of the log-normal distribution are estimated using an empirical Bayes procedure. Then, for every gene $i$, the model is applied a point estimate of  the overdispersion parameter $\alpha$ is obtained. Finally, they use these point estimates and the Wald test to determine if a gene is differentially expressed. More recently, \cite{law2014voom} proposed  a log transformation of the read counts after adjusting for library size, and to analyze the transformed data as the intensity continuos data arising from a microarray experiment, but without assuming equal variances across genes. Instead, they propose using a modified version of the empirical Bayes procedure available in the limma package \citep{smyth2005limma} that incorporates the mean-variance trend as part of the statistical model. They discuss two alternatives to model the mean-variance trend, \emph{limma-trend} and \emph{voom}.

\cite{rapaport2013comprehensive} compares the performance of DESeq, \textit{edge} R, baySeq, and other methods (but not A\&D)
using benchmarks data sets. They conclude that there is no a uniform best method in all the scenarios of their comparisons. However, they remark that apparently the methods based on the negative binomial distribution (mentioned above) perform  better in terms of specificity and sensitivity.

Here, we propose a Bayesian model based inference procedure to detect differentially expressed genes (DEG) in two populations. %where we assume \emph{a priori} that the value of $\alpha$ is small. 
Our approach allows for libraries of different sizes and %but, %in contrast to \cite{Robinson:Smyth:2008}, 
assumes a different $\alpha_i$  for each gene. It declares a  gene to be DEG based on its posterior probability of being differentially expressed. In contrast to \cite{Anders:Huber:2010}, our model does not assume any functional relationship between $\alpha_i$ and $\mu_i$ and in contrast to \cite{hardcastle:kelly:2010}, we specify the prior distributions for $\mu$ and $\alpha$, avoiding the possible overfitting that sometimes results from data-dependent priors. On the other hand, we propose an empirical Bayes procedure to estimate hyper-parameters  of the prior distribution of $\alpha$, but contrary to  \cite{wu2013new}  that implements a Wald test, we propose a Bayesian hypothesis framework using Bayes factors comparing both the null and alternative hypotheses in order to make decisions. %Since the p-values are  based only on the null hypothesis, the tests based on p-values require the gene to have high counts to declare them as in DEG. This is not the case when using Bayes factors, since it depends not only on the likelihood under the null (no DEG) but also on the likelihood under the alternative (DEG).
Simulation results show that our approach competes favorable with the inference obtained by using DESeq, baySeq and A\&D.

The rest of the paper is organized as follows: in Section \ref{sec:overdispersion} we discuss the estimation of the overdispersion parameter, and in Section \ref{sec:testing} we introduce the Bayesian framework to test for DEG. In Section \ref{sec:simulate} we examine the performance of our procedure under a number of simulation scenarios, and compare our approach to DESeq, A\&D, baySeq and edgeR. In Section \ref{sec:application}  we illustrate  our method analyzing a real data set and contrast our results to those obtained by other methods. We end with a short discussion of the method in Section \ref{sec:disc} and include an appendix with some of the technical details.

%\maketitle
\section{Estimation of the Overdispersion Parameter}\label{sec:overdispersion}
%In the negative binomial distribution $\hat{\mu}=\bar{y}$ regardless
%of the value of $\alpha$. 
%In this section we show how to compute the marginal MLE of $\alpha$, and compare its performance to that of the MLE. 

%\subsection{Instability of the maximum likelihood estimator}
 \begin{table}[b]
 \caption{\label{tab:smallnb} \textsc{\small Five negative binomial samples each with maximum likelihood estimates for the mean $\mu$ and overdispersion parameter $\alpha$.  The reported standard deviation is $\sqrt{\hat \mu+ \hat \alpha {\hat \mu}^2}$ }.}
 \begin{center}
 \begin{tabular}{c|c|c|c}
 Sample&$\hat{\alpha}$&$\hat \mu$&Std. Dev.\\
 \hline
 \vspace{-.1in}&&\\
 $2 ,3 ,4 ,5 ,8$&$0.000$&$4.40$& $2.097$\\
$2 ,3, 4, 5, 9$&$0.052$&$4.60$&$2.386$\\
%$2,  3, 4,  5, 12$&$0.215$&$5.20$&$3.319$\\
$2,  3, 4,  3, 11$&$0.210$&$4.60$&$3.006$\\
$2,  3, 4,  2, 12$&$0.329$&$4.60$&$3.402$\\
\hline
\end{tabular}
\end{center}
\end{table}
When only a small sample from a negative-binomial distribution is available (a common feature in the analysis of RNA-Seq data) the maximum likelihood estimator (MLE) $\hat{\alpha}$, of the overdispersion parameter is unstable.  %, as we demonstrate below. The MLE $\hat{\alpha}$ is unstable.
For instance, %under the parametrization in (\ref{NB_density_alpha}) it is clear that the variance is larger than the mean.  However, if the sample size is small, it is likely that the sample mean is larger than the sample variance, yielding an estimate $\hat{\alpha}$ equal to zero.
when  the sample mean is greater than the sample variance,  the maximum is attained at a negative value, and in such cases the estimator is truncated at zero. If this is not the case, the MLE of the overdispersion parameter typically exhibit a large variability. Table \ref {tab:smallnb} illustrates the effect on the estimation of $\alpha$ of small  perturbations in a sample of size five. We observe that even small changes in a single observation of the sample may greatly affect the estimation of the overdispersion parameter and consequently have an effect on the inference about $\mu$, increasing of the standard error of up to $60\%$, without a significant increment in the estimated value of the mean.

\begin{figure}\label{fig:boot}
\begin{center}
\includegraphics[width=3.5in,height=3in, angle=270 ]{StdPlot-2.eps}\\
\end{center}
\caption{\label{fig:boot}\textsc{\small Values of $\hat \alpha$ ($x$-axis) and the corresponding standard deviation of $\hat \mu$ ($y$-axis) for $5000$ bootstrap samples of the RNA-Seq data shown in the bacteroides counts example.  The minimum standard deviation is $20.53$ and the maximum is $53949.37$. The red dot indicates the value for the original sample.} }
\end{figure}

In a more realistic scenario, consider the following data from a pilot project to determine bacterial community differences across time for individuals at high risk for type 1 diabetes.  Using 454 pyrosequencing of amplified 16S rRNA genes, the counts of bacteroides from ten children are 118, 131, 136, 176, 274, 1022, 1675, 14137, 15714 and 60886.
%\begin{equation}\label{eq:data}
%118,131,136,176,274,1022,1675,14137,15714,60886.
%\end{equation}
In order to illustrate the variability in the MLE's of $\mu$ and $\alpha$, we took $5000$ bootstrap samples of these data. The estimated values of $\alpha$ and the corresponding estimated standard deviation of $\hat{\mu}$ obtained for each sample are depicted in  Figure \ref{fig:boot}.  We observe a huge bootstrap variability suggesting that the sampling variability will be of equal size.

The problems with the MLE of the overdispersion parameter  have been discussed in the literature and \cite{Robinson:Smyth:2008} introduce a quasilikelihood estimator that performs better than the MLE when estimating $\alpha$. Here, we propose that the variability of the estimator can be controlled using a marginal MLE instead. This marginal MLE of $\alpha$ is obtained by first integrating the parameter $\mu$ out of the likelihood  in (\ref{NB_density_alpha}) with respect to a conjugate distribution and then by maximizing  the resulting marginal likelihood with respect to $\alpha$.
% The resulting estimator turns out to be very close to an overdispersion estimate from a conjugate Bayesian hierarchy.  
%The marginal density of $\alpha$ is obtained by integrating $\mu$ out of the expression in (\ref{NB_density_alpha}) .

To accomplish  this, we first observe that the $\text{F}$-distribution is a conjugate prior for $\mu$ in this setting and assume that $\mu \vert \alpha$ $\sim$ $\text{F}(\nu_1,\nu_2)$, where $\nu_1$ and $\nu_2$ denote the degrees of freedom.  In order to obtain a simple closed form expression for the model and, at the same time, preserve its hierarchical structure, we take $\nu_1=2a_\mu$ and $\nu_2=2a_\mu/\alpha$, with $a_\mu>0$. This way,  the conditional density is
\begin{equation}\label{cond_density}
p(\mu\mid\a)=\frac{1}{{\cal B}(a_\mu,a_\mu/\a)} \frac{\a^{a_\mu} \mu^{a_\mu-1}}{(1+\a\mu)^{a_\mu+a_\mu/\a}},
\end{equation}
and for $\kv= (k_1,\dots,k_J)$, the integrated likelihood is given by
\begin{eqnarray}\label{neg_bin_mu_marginalized}
p(\kv\mid\alpha)&=&\int_0^\infty p(\kv\mid\alpha,\mu)p(\mu\mid\alpha)\,d\mu\\
&=&\left[ \prod_j \frac{1}{{\cal B}(k_{j}+1,\a^{-1}) (k_{j}+\a^{-1})    }\right]
\frac{{\cal B}(a_\mu+\sum_j k_j,(J+a_\mu)/\alpha)}{{\cal B}(a_\mu,a_\mu/\alpha)},\nonumber
\end{eqnarray}
where  $p(\kv\mid\alpha,\mu)=\prod_j p(k_j \mid\alpha,\mu)$ is the likelihood function and the $k_j$'s are iid $\text{NegBin}(\mu,\a)$, for all $j$.
%We finally set $\tilde{\a}=\arg \max_\a p(\kv\mid\a)$.
Finally, to complete the specification of the model, we have to choose a value for the constant $a_\mu$. From (\ref{cond_density}) we observe that $E(\mu\mid\alpha)=a_\mu/(a_\mu-\alpha)$, when $a_\mu>\alpha$ and the expectation does not exist when $a_\mu\leq \alpha$. Therefore, in oder to reduce the impact that the parameter $\alpha$ has on the random behavior of $\mu$, we prefer small values of $a_\mu$ that produce densities less informative with heavier tails.

It follows that the three estimators under consideration are:
\begin{enumerate}
\item  $\hat{\alpha} = \mbox{argmax}_\a \{ \max_\mu p(\kv\mid\alpha,\mu)\}$, the MLE, % =  \mbox{argmax}_\a  p(\kv\mid\alpha,\bar{\textbf{k}})
\item  $\tilde{\alpha} = \mbox{argmax} \; p(\kv\mid\alpha)$, the marginal MLE, and
\item $\hat{\alpha}_{QL}$, the quasilikelihood estimator proposed by  \cite{Robinson:Smyth:2008}.
\end{enumerate}
%where $\bar{\textbf{k}}=J^{-1}\sum_{i=1}^Jk_i$. In other words, the MLE $\hat{\alpha}$, is computed by maximizing $p(\kv\mid\alpha,\mu)$ in $\alpha$ after replacing $\mu$  by the sample mean $\bar{\textbf{k}}$.  When  the sample mean is greater than the sample variance,  the maximum is attained at a negative value, and in such cases the estimator is truncated at zero.  In contrast, the marginal MLE $\tilde{\a}$ is, by construction, greater than zero. 
We compare the performance of each one of these estimators in different scenarios and summarize the results in Table \ref{table:simresults_Imu}. %, which is similar to Table 1 in \cite{Piegorsch:1990}, where he explores the distribution of the MLE of $\alpha$. 
We observe that for small sample sizes the MLE $\hat \alpha$ does not perform well: it is often truncated to zero and has mean squared error much larger than the marginal MLE $\tilde \alpha$, which by construction, is always greater than zero.  Although the MLE improves as $\mu$ or $n$ increases, it is still outperformed by the marginal MLE.   Furthermore, we observe that in practically all the considered settings, the marginal MLE produce estimators  closer (on average) to the true value and better, in terms of the mean square error (MSE), than the quasilikelihood estimator, offering a more stable and reliable estimator.

\begin{table}
%Table generated Project 9 in R program DESseq\_dros\_negbin\_reg
\caption{\label{table:simresults_Imu} \textsc{\small 
Comparison of estimators of the overdispersion parameter of the negative binomial distribution.  
The MLE is $\hat{\alpha}$, the marginal MLE is $\tilde{\alpha}$, and 
the quasilikelihood is $\hat{\alpha}_{QS}$.
Each row represents a different negative binomial distribution with mean $\mu$, overdispersion $\alpha$, and sample size $n$.  
 The values of the mean, median, and mean squared error (MSE) were obtained based on $1000$ negative binomial samples.
The last column gives the proportion of times that the solution to the likelihood equations was negative, which truncates the MLE to zero.  
 In the calculations $a_\mu$ was set equal to 0.01.}}
%\textcolor{red}{Table 1 in file NB\_forcasellaApril.tex is the table including the comparison with the quasilikelihood estimate of $\alpha$}}}
%\textcolor{red}{RED} indicates we are maximazing the log-like wrt to $\a$ and $a$, fixing $c=3$ in Dr Casella's prior.
%\textcolor{blue}{BLUE} indicates we are maximazing the log-like wrt to $\a$,fixing $a=0$ and  $c=3$.
%\textcolor{red}{See Table generated Project 9 in R program DESseq\_dros\_negbin\_reg}}}
\begin{center}
{\small
\begin{tabular}{lll| lll| lll| lll| l}
 \multicolumn{3}{c}{True Values}&
  \multicolumn{3}{c}{$\tilde{\a}$}&
\multicolumn{3}{c}{$\hat{\a}$}&
\multicolumn{3}{c}{$\hat{\a}_{QS}$}
\\
$\mu $ &$\alpha$ &$n$& mean &median & MSE &mean &median & MSE &mean &median & MSE & $\% \hat{\a}_{\max}<0$\\
\hline
\multicolumn{13}{c}{Coefficient of variation, $\sqrt{1/\mu+\alpha}$ equal to 1.1 }\\
1&0.21&3&0.101&0&0.15&6.408&0&608.101&1.841&0.605&11.525&70.5 \\ 
 1&0.21&10&0.187&0&0.161&0.315&0&0.416&0.467&0.317&0.311&55.1 \\  
 1&0.21&50&0.195&0.126&0.046&0.217&0.149&0.053&0.379&0.359&0.083&27.5 \\  
 10&1.11&3&0.918&0.607&1.305&1.33&0.6&31.503&1.893&1.197&4.748&13.1 \\  
10&1.11&10&1.032&0.928&0.381&1.049&0.934&0.447&1.41&1.291&0.722&0\\ 
 10&1.11&50&1.089&1.071&0.058&1.092&1.073&0.059&1.339&1.324&0.146&0 \\  
100&1.2&3&0.9&0.701&0.775&0.895&0.645&0.988&1.578&1.074&2.934&1.3 \\ 
 100&1.2&10&1.112&1.05&0.24&1.114&1.045&0.261&1.473&1.352&0.612&0 \\  
 100&1.2&50&1.186&1.176&0.048&1.187&1.177&0.049&1.439&1.423&0.146&0 \\  
 1000&1.209&3&0.888&0.707&0.645&0.856&0.639&0.784&1.529&1.057&2.496&0.1 \\  
 1000&1.209&10&1.097&1.039&0.205&1.092&1.031&0.221&1.437&1.326&0.503&0 \\  
 1000&1.209&50&1.193&1.19&0.045&1.192&1.19&0.045&1.441&1.433&0.138&0 \\  
\hline
\multicolumn{13}{c}{Coefficient of variation equal to 1.5 }\\
1&1.25&3&0.286&0&1.478&14.838&0&1386.5&2.76&1.341&13.938&49.2 \\ 

 1&1.25&10&0.816&0.436&1.579&1.568&0.674&33.71&1.09&0.991&0.948&24.5 \\  
 1&1.25&50&1.162&1.087&0.364&1.238&1.151&0.394&1.106&1.102&0.158&0.6 \\  
 10&2.15&3&1.444&0.932&3.329&3.252&1.051&148.871&2.946&2.21&7.804&10.9 \\  
 10&2.15&10&1.986&1.76&1.153&2.09&1.834&1.429&2.616&2.448&1.508&0 \\  
 10&2.15&50&2.106&2.053&0.198&2.125&2.072&0.204&2.534&2.509&0.367&0 \\  
 100&2.24&3&1.78&1.266&2.99&1.97&1.281&4.882&3.278&2.316&9.028&0.9 \\  
 100&2.24&10&2.095&1.952&0.813&2.15&1.995&0.911&2.95&2.792&2.112&0 \\  
 100&2.24&50&2.212&2.186&0.151&2.224&2.198&0.154&2.844&2.82&0.631&0 \\  
 1000&2.249&3&1.709&1.309&2.491&1.818&1.304&3.949&3.173&2.333&8.563&0.3 \\ 
 1000&2.249&10&2.123&2.001&0.707&2.166&2.038&0.774&3.061&2.88&2.393&0 \\  
 1000&2.249&50&2.22&2.195&0.147&2.23&2.205&0.15&2.913&2.879&0.749&0 \\  
%%%THE BELOW VALUES ARE CORRECT BUT I REMOVED THEM FROM THE TABLE
%TO REDUCE IT
  %\hline
 %\hline
%1&1&3&0.254&0.01&0.941&12.984&0&1216.726&0&0&1&51.7\\%quasi
 %1&1&10&0.67&0.344&1.057&1.022&0.545&2.582&0.968&0.885&0.549&26.5 \\%quasi
 %1&1&20&0.85&0.705&0.615&1.016&0.837&0.786&0.983&0.959&0.295&9.6 \\%quasi
 %1&1&30&0.88&0.771&0.434&0.991&0.864&0.516&0.958&0.944&0.181&3.7 \\%quasi
 %1&1&50&0.934&0.865&0.272&0.998&0.92&0.295&0.965&0.955&0.12&0.5 \\%quasi
 %\hline
%1&1/3&3&0.124&0.01&0.203&7.675&0&725.874&0&0&0.111&64.5 \\%quasi
 %1&1/3&10&0.255&0.01&0.251&0.42&0&0.731&0.544&0.354&0.324&49.2 \\%quasi
 %1&1/3&20&0.279&0.137&0.133&0.345&0.206&0.184&0.511&0.463&0.178&31.3 \\%quasi
% 1&1/3&30&0.296&0.207&0.109&0.341&0.252&0.135&0.504&0.491&0.134&24.6 \\%quasi
 %1&1/3&50&0.294&0.254&0.07&0.321&0.282&0.078&0.479&0.478&0.085&15.4 \\%quasi
%\hline
 %1&0.2&3&0.102&0.01&0.136&6.298&0&598.23&0&0&0.04&71 \\%quasi
 %1&0.2&10&0.197&0.01&0.177&0.322&0&0.529&0.475&0.352&0.32&53.3 \\%quasi
 %1&0.2&20&0.197&0.05&0.088&0.249&0.088&0.138&0.408&0.357&0.161&42.7 \\%quasi
 %1&0.2&30&0.192&0.089&0.061&0.222&0.121&0.08&0.389&0.351&0.117&36.1 \\%quasi
 %1&0.2&50&0.198&0.127&0.046&0.217&0.152&0.054&0.378&0.357&0.087&26.7 \\%quasi
%\hline
 %10&3&3&1.884&1.283&5.608&5.576&1.702&309.145&0.112&0.015&8.368&9 \\%quasi
 %10&3&10&2.708&2.418&2.234&2.911&2.561&3.025&3.364&3.258&1.911&0 \\%quasi
 %10&3&20&2.894&2.72&1.147&2.993&2.795&1.342&3.379&3.296&0.954&0 \\%quasi
 %10&3&30&2.906&2.792&0.644&2.968&2.846&0.689&3.345&3.306&0.611&0 \\%quasi
 %10&3&50&2.943&2.88&0.428&2.98&2.918&0.445&3.331&3.328&0.435&0 \\%quasi

%\hline
 %10&2&3&1.369&0.95&2.783&2.439&1.026&81.277&0.174&0.003&13.322&10.9 \\%quasi
 %10&2&10&1.839&1.664&0.989&1.926&1.731&1.203&2.457&2.34&1.377&0 \\%quasi
 %10&2&20&1.933&1.847&0.441&1.975&1.883&0.482&2.428&2.397&0.708&0 \\%quasi
 %10&2&30&1.94&1.88&0.274&1.967&1.903&0.289&2.395&2.361&0.484&0 \\%quasi
 %10&2&50&1.969&1.943&0.172&1.986&1.96&0.178&2.388&2.382&0.355&0 \\%quasi
%\hline
%10&1&3&0.734&0.438&0.932&1.099&0.386&30.891&0.032&0&0.942&16.1\\%quasi
%10&1&10&0.896&0.82&0.203&0.902&0.816&0.227&1.218&1.108&0.438&0 \\%quasi
 %10&1&20&0.954&0.908&0.116&0.958&0.909&0.123&1.213&1.165&0.252&0 \\%quasi
 %10&1&30&0.973&0.955&0.078&0.976&0.957&0.081&1.212&1.18&0.179&0 \\%quasi
 %10&1&50&0.984&0.982&0.047&0.986&0.983&0.048&1.203&1.191&0.12&0 \\%quasi\hline
%\hline
%500&3&3&2.325&1.764&4.448&2.952&1.83&37.042&1.279&0.778&4.89&0.2\\%quasi
%1000&3&3&2.299&1.7&4.492&2.57&1.744&8.009&2.678&1.645&9.011&0.3\\%quasi
%1000&1&3&0.695&0.582&0.408&0.646&0.502&0.493&1.333&0.962&1.708&0.2\\%quasi
\end{tabular}
}
\end{center}
\end{table}

\section{Testing for  Differentially Expressed Genes}\label{sec:testing}
%In this section we consider  a Bayesian hypothesis testing framework.  Note that the Bayesian framework implicitly considers the marginal distribution of Section \ref{sec:overdispersion}, and thus enjoys the same stability properties as the marginal MLE.

%In order to construct a Bayesian testing procedure to detect DEG's, we consider we cons
%The structure of the data set is a table where the element in row $i$ and column $j$  is the  number of reads aligned to gene $i$ in the individual $j$.
%The number of individuals is $J_1+J_2$.
Suppose that we have two treatments and let $J_1$ and $J_2$ be the number of individuals under treatments 1 and 2 respectively. Assume that the individuals labeled with $j=1,\dots,J_1$ received the first treatment and the individuals labeled with $j=J_1+1,\dots,J_1+J_2$ received the second treatment. Denote by $k_{ij}$ the number of reads aligned to gene $i$ in individual $j$ and recall that  $s_j$ corresponds to the library size or abundance for the individual $j$. %We will replace $s_j$ with $\hat{s_j}$ in the applications.
In this context, we observe that the problem of testing whether gene $i$ is differentially expressed can be looked as a model selection problem and consider a Bayesian framework to compare the hypotheses
\begin{equation}\label{twocompetingmodel}
\begin{array}{rl}
H_{0i}: &k_{ij}\sim \text{NegBin}(s_j\mu_{i0},\alpha_{i0}),   \quad j=1,\dots,J_1+J_2\\
&\mu_{i0}\mid\a_{i0}\sim\text{F}(2a_\mu,2a_\mu/\alpha_{i0})\hbox{  and }
\alpha_{i0}\sim \text{Gamma}(u_0,v_0)\\

H_{1i}:&k_{ij}\sim \text{NegBin}(s_j\mu_{i1},\alpha_{i1}),\quad j=1,\dots,J_1\\
&k_{ij}\sim \text{NegBin}(s_j\mu_{i2},\alpha_{i1}),\quad j=J_1+1,\dots,J_1+J_2\\
&\mu_{i1},\mu_{i2}\mid\a_{i1}\iid \text{F}(2a_\mu,2a_\mu/\alpha_{i1}) \hbox{ and } 
\alpha_{i1}\sim \text{Gamma}(u_1,v_1),
\end{array}
\end{equation}
where $\text{Gamma}(u,v)$ is the gamma distribution with expectation $u/v$. %Throughout the rest of the paper we will use the notation $H_{m,i}$ to refer to either the hypothesis or the model.
Observe that the means of the negative binomial distributions are adjusted by the library size $s_j$ (a typical feature of these models). In practice, the value of $s_j$ is assumed to be known or estimated form the data and taken as the true value. Here, we follow the strategy in \cite{Anders:Huber:2010}, and estimate estimate $s_j$ as 
%following equation (5) in Anders and Huber~(2010),
\begin{equation}\label{libsize}
\hat{s}_j= \text{median}_i \frac{k_{ij}}{(\prod_{v=1}^{J_1+J_2} k_{iv})^{1/(J_1+J_2)}}.
\end{equation}

For the overdispersion parameters we consider only one value per gene under each hypothesis. Even though the model is flexible enough to allow for two different values of the overdispersion parameter $\alpha_{i1}$ under $H_{1i}$, in real applications the addition of an extra overdispersion parameter makes the estimation problem much more difficult and some times not feasible in situations when only a few counts are available. Nonetheless, notice that the hierarchical structure of this framework implicitly considers the marginal distribution of Section \ref{sec:overdispersion}, and therefore takes advantage of the stability properties of the marginal MLE of the overdispersion parameter. 

In order to complete the specification of the models,  we need to determine the values of the hyperparameters of the Gamma priors. Here we take an empirical Bayes approach and consider the following procedure: to determine $u_0$ and $v_0$ we estimate, for every gene $i$, the marginal MLE $\tilde{\alpha}_{i0}$ of the overdispersion parameter, assuming that the count means are the same in both treatments. Once the values of $\tilde{\alpha}_{i0}$'s are obtained,  we consider  $\tilde{\alpha}_{1,0},\dots,\tilde{\alpha}_{n_{genes},0}$ to be random sample from \text{gamma}$(u_0,v_0)$ and set $u_0$ and $v_0$ equal to  the MLE's. For the values of $u_1$ and $v_1$ we follow the same strategy, but using only the control group data. Of course, some variations can be considered, but in practice they lead to similar values for the hyperparameters and have little impact on the performance of the model.

Finally, to specify the prior probabilities $P(H_{0i})$ and $P(H_{1i})$ of the models we have a few alternatives. For instance, we can assume that the probabilities $P(H_{1i}), i=1,\dots,n_{genes}$ are observations from an underlying beta distribution and assign prior distributions for the beta distribution parameters and, therefore, induce a dependency in the posterior distribution across the genes. Instead, we can simply assume that  $P(H_{1i}):=\pi_1$ is the same for all genes, so the tests remain independent. If this is the case we observe that the ranks of the posterior probabilities do not change. That is, the list of $G$ genes with highest posterior probability using $P(H_{1i}):=\pi_1, \forall i,$  is the same as when using  $P(H_{1i}):=\pi_1^\prime,\forall i,$ with $0<\pi_1,\pi_1^\prime<1$. The choice of $\pi_1$ has an impact only on the estimation of the posterior expectation of the false discovery proportion (FDP) (see Section \ref{sec:simulate}). Hence, for each gene we can approximate the Bayes Factor (BF), in favor of the model $H_{1,i}$, $BF_{i,10}\equiv p(\kv_i\mid H_{1i})/p(\kv_i\mid H_{0i})$, and estimate $\pi_0=1-\pi_1$ following the strategy in \cite{wen2013robust}:
 \begin{enumerate}
 \item Sort the observed BFs in ascending order: $BF_{(1),10},\dots,BF_{(n_{genes}),10}$.
 \item Find $d_0= \max\{d: (1/d) \sum_{i=1}^d BF_{(i),10}<1\}$.
 \item Set $\tilde{\pi}_0=d_0/n_{genes}$ and $\tilde{\pi}_1=1-\tilde{\pi}_0$.
 \end{enumerate}
 
%Observe that from the Bayes theorem we have
%\begin{equation}\label{eq:postprob}
%P(H_{1i}\mid\kv_i)=\frac{p(\kv_i\mid H_{1i})P(H_{1i})}{p(\kv_i\mid H_{0i})P(H_{0i})+p(\kv_i\mid H_{1i})P(H_{1i}) }=
%\frac{BF_{i,10} \tilde{\pi}_1}
%{(1-\tilde{\pi}_1)+BF_{i,10} \tilde{\pi}_1} .
%\end{equation}
Observe that when the abundances $s_j$ are all equal to 1, it follows from \eqref{neg_bin_mu_marginalized} that 
the computation of $p(\kv_i\mid H_{mi})$, $m=0,1$, reduces to calculating (numerically) a one dimensional integral. When $s_j$ are not all equal to one we can compute the Bayes factor
$BF_{i,10}$ using the Gibbs sampling algorithm included in the Appendix \ref{app:gibbs}.

%We also note that the model above gives high posterior probabilities to
%$H_{1i}$ in the case of having all counts in one treatment equal to zero, and at least one count in the other treatment is not zero.  It is not appropriate to test such genes for DEG with this test. \note{no it works even in this cases}

\section{Simulation Studies}\label{sec:simulate}

In this section we consider three different simulation studies to compare the performance of our method with DESeq,  baySeq, edgeR and the A\&D procedures:\begin{enumerate}
\item Study $1$:  Here we assume the abundances are known and equal to $1$, and only a small number of genes is considered.  
Two subscenarios are explored: (a) the values of the overdispersion parameter are set to make the simulation favorable for DESeq, and (b) the values of the overdispersion parameter are set to make the simulation not favorable for DESeq  
\item Study $2$: Here we assume the  abundances are unknown, and we use $10,000$ genes with $240$ differentially expressed.  We use the estimated means ($\mu$'s) from DESeq as the true values for the simulation. The overdispersion parameters  ($\alpha$'s) take values between 0 and 0.5 and are simulated from a $\text{Beta}(0.3,0.3)/2$ distribution.

\item Study $3$: Use the same conditions  as Study $2$, but we take the values of the overdispersion parameters $\alpha'$s equal to the DESeq estimate. 
\end{enumerate}
Observe that all three simulation studies are designed to meet the DESeq assumptions, with Studies $1$(a) and $3$ satisfying them exactly, while in studies $1$(b) and 2 the true value of the overdispersion parameter not a function of the mean. Table \ref{table:sim_scenarios} summarizes the simulation scenarios described above.  
 
\begin{table}
\caption{\label{table:sim_scenarios} \textsc{\small 
Summary of the simulation true parameters under the three scenarios described in the text. DESeq estimates means that the simulation true parameters of $\alpha$
were set equal to their DESeq estimated values as explained in the text.}}
\begin{center}
\begin{tabular}{ r|cc |c|c}
%\multicolumn{1}{c}{}&\multicolumn{1}{c}{}&
%\multicolumn{1}{c}{}&
%\multicolumn{2}{c}{} &\multicolumn{1}{c}{}\\
\multicolumn{1}{c}{Study}&\multicolumn{1}{c}{$N^o$ genes}&\multicolumn{1}{c}{$N^o$ DEG}
& \multicolumn{1}{c}{True $\alpha$'s}
&\multicolumn{1}{c}{Library Size}\\
\hline
1 a&\multirow{2}{*}{$10^2$}&\multirow{2}{*}{20}&\multicolumn{1}{c|}{DESeq estimates}&\multirow{2}{*}{all 1}\\
\cline{4-4}
1 b& & &\multicolumn{1}{c|}{Uniform(0,0.7)}\\
\hline
\multirow{2}{*}{2}&\multirow{3}{*}{$10^4$}&
\multirow{3}{*}{240}&\multirow{2}{*}{\text{Beta}(0.3,0.3)/2}&$s_1=s_3=0.8,$\\
& & & & $s_2=s_4=1$, and\\
\cline{4-4}
3& & &\multicolumn{1}{c}{DESeq estimates}&\multicolumn{1}{|c}{$s_3=s_6=1.2$}\\
\hline
\end{tabular}
\end{center}
\end{table}
In order to compare the performance of the procedures in terms of the false discovery proportion, we first define $d_i$ as an indicator variable to indicate the decision, that is $d_i=0$ when the $i$-th null hypothesis is accepted and $d_i=1$ otherwise. Likewise, we define the variable $r_i=0$ if indeed the null hypothesis $i$ in \eqref{twocompetingmodel} is true and $r_i=1$ if the alternative is true. This way, the FDP is defined as %and False Negative Rate are
\begin{equation*}
FDP=\frac{\sum_i d_i(1-r_i)}{\sum_i d_i},%  \qquad  FNR:=\sum_i (1-\delta_i)r_i/\sum_i (1-\delta_i)
\end{equation*}
and the corresponding posterior expectation is
\begin{equation*}
{\rm E} (\mbox{FDP $\vert$ {\it data}}) = \frac{\sum_i d_i[1-P(H_{1i}\mid\kv_i)]}{\sum_i d_i}.
\end{equation*}
%Note that this does not necessarily control the FDR, but rather estimates it.  
DESeq implements the \cite{Benjamini:Hochberg:1995} procedure to control the FDP.  In contrast, when testing the hypotheses in \eqref{twocompetingmodel}, we  declare the $n_{sel}$  genes with the highest $P(H_{1i}\mid \kv_i)$ %in (\ref{eq:postprob}) 
as DEG and estimate the  corresponding expected FDP \citep[see][]{Newton:2004}. 

\begin{figure}[]
%Dataset generated simulating_sample
%Dataset name: dataforC_abundance_1_favoringDESeq
%analyzed with c project BMF2withAbundances
%Figure generated with Analysing_sims.R
\caption{\label{fig:BayesFactor_100genes-A} \textsc{\small 
Comparison of different procedures to select DEG 
under the simulation scenario $1$(a).  The left panel compares the ROC curves, 
and the right panel depicts the simulation true FDP (solid) and the controlled FDP reported by the different approaches (dotted).  =
Scenario 1 Favors DESeq and baySeq,  $\a_i=\a_i^{DESeq}$.}The numbers in parentheses correspond to the Area Under the curves (AUC).}
%$$
%\begin{array}{rl}
\includegraphics[width=2.75in,height=3.25in,angle=270]{ROCs_ngenes100_abundance_1_favoringDEseq.eps}
\includegraphics[width=2.75in,height=3.25in,angle=270]{FDR_ngenes100_abundance_1_favoringDEseq.eps}
%\multicolumn{2}{c}{\hbox{Scenario Favoring DESeq and baySeq, } \a_i=\a_i^{DESeq}}\\
%\includegraphics[width=3.5in,height=3.25in,angle=270]{\plotpath/BMvsDESeq_100genesalphasrandom.eps}&
%\includegraphics[width=3.5in,height=3.25in,angle=270]{\plotpath/FDR_BMvsDESeq_100genesalphasrandom.eps}\\
%\multicolumn{2}{c}{\hbox{Scenario Favoring DESeq and baySeq, } \a_i\sim Unif(0,0.7)}\\
%\end{array}
%$$
\end{figure}

\begin{figure}[]
\caption{\label{fig:BayesFactor_100genes-B} \textsc{\small Comparison of different procedures to select DEG 
under the simulation scenario $1$(b).  The left panel compares the ROC curves, 
and the right panel depicts the simulation true FDP (solid) and the controlled FDP reported by the different approaches (dotted).    %Scenario Favoring DESeq and baySeq, 
In the simulation truth, $ \a_i\sim Unif(0,0.7)$. baySeq does not do well (left) and 
DESeq overestimates the FDP (right). The numbers in parentheses correspond to the Area Under the curves (AUC).
}}
%$$
%\begin{array}{rl}
%\multicolumn{2}{c}{\hbox{Scenario Favoring DESeq and baySeq, } \a_i=\a_i^{DESeq}}\\
\includegraphics[width=2.75in,height=3.25in,angle=270]{ROCs_ngenes100_abundance_1_favoringImu.eps}
\includegraphics[width=2.75in,height=3.25in,angle=270]{FDR_ngenes100_abundance_1_favoringImu.eps}
%\multicolumn{2}{c}{\hbox{Scenario Favoring DESeq and baySeq, } \a_i\sim Unif(0,0.7)}\\
%\end{array}
%$$
\end{figure}

\subsection{Study 1:  Few genes and abundances equal to one}\label{sec:abundance-1}
We compare DESeq, baySeq, edgeR and A\&D to the proposed approach. 
In all analyses of simulated data in this paper, regardless of the approach,
we
used the simulation true abundances (as opposed to 
estimating the abundances in the way proposed by each approach). 
We simulate counts of  \emph{Treatment 1} with $J_1=3$ individuals  
as follows:
\begin{enumerate}
\item We used the data set ``TagSeqExample.tab'' included in the DESeq R library. More specifically, we used the 
first 100 genes whose estimated DESeq base means are greater than 10 in the 3 samples labeled with T1b,T2 and T3, and estimated the library sizes according to \eqref{libsize}.
\item We estimate $\mu_i^{DESeq}=\text{baseMean}$ and $\alpha_i$ as  $\alpha_{i}^{DESeq}=\text{fittedRawVar}/\text{baseMean}^2$.
The values \text{baseMean} and \text{fittedRawVar} are estimated by using the R function ``nbinomTest'' in the DESeq R library.
\item We used these estimates as the true values for the simulation in the \emph{Treatment 1} group. That is, we simulated $k_{ij}\iid \text{NegBin} (\mu_i,\a_i)$ for $j=1,2,3$ where $\mu_i$ and 
\begin{enumerate}
\item $\alpha_i$ are set to the estimated values in 2.  (Note that by using these values of $\alpha_i$ the simulation fully satisfies the DESeq 
assumptions, making this simulation the most favorable for DESeq.)
\item $\a_i\sim Unif(0,0.7)$ favoring our procedure.
\end{enumerate}
\item
For \emph{Treatment 2} we considered the same number of individuals, $J_2=3$. The first 20 genes are differentially expressed (they have different means from treatment 1)  while the remaining 80 share the same mean as their corresponding gene in the treatment 1 group. For all individuals we set the true abundances  for the simulation to be $s_j=1$ and assume them known in all analyses.  More specifically, $k_{ij}\iid \text{NegBin} (c_i \mu_i^{DESeq},\a_i^{DESeq})$ for $j=4,5,6$ with \
$c_1=6,c_2=5.75,c_3=5.5,\dots,c_{20}=1.25$.
%$c_i=1+5[(20-i+1)/20]\times1(i\leq 20)$, 
%so gene $1$ in treatment 2  has a mean that is 
This implies, for instance, that the true mean counts of the first DEG in the treatment 2 group is $6$-fold larger than its treatment 1 counterpart. 
\end{enumerate}
%\textcolor{red}{See program simulation\_sample.r.}

Figures \ref{fig:BayesFactor_100genes-A} and \ref{fig:BayesFactor_100genes-B}
compare the results of DESeq,  baySeq and A\&D with the proposed Bayes model (BM). We observe that even though the simulations settings are designed to favor the DESeq and baySeq assumptions, the Bayes model gives practically the same results in terms of ROC curves and true FDP. Furthermore, in these scenarios the BM procedure does a better job estimating and reporting the false discovery proportion (dotted line on the right panel in both figures) than the competitors.

%Both models essentially select the same number of true DEG.  

\subsection{Studies $2$ and $3$:  Simulation study with abundances}\label{sec:study2-3}
%\textcolor{red}{See r program simulatingforC and cproject BMF2withabundanceandH0.}

%Appendix \ref{app:strategy} describes how the data for Studies $2$ and $3$ were generated. Remember that DESeq assumes that genes with similar means have similar overdispersion parameters, that is,
%if $\mu_i\approx \mu_j$ then $\alpha_i\approx\a_j$.
%Under Study 2 the true $\alpha'$s for the simulation do not satisfy this DESeq assumption. Under Study 3 this assumption is fulfilled. 
Recall that DESeq assumes that genes with similar means have similar overdispersion parameters, that is, if $\mu_i\approx \mu_j$ then $\alpha_i\approx\a_j$. This condition is satisfied in Study 3, but not in Study 2. Specifically, we simulated a dataset with ten thousand genes and two treatments, with three individuals per treatment. The values for the simulation parameters were set based on the Drosophila data described in Section \ref{sec:application}. Then, we estimated the means of 9760 counts using DESeq and  compute the empirical deciles: $q_{0.1},\dots,q_{0.9}$ and the quantile $q_{0.95}$. Only the first 240 genes in the simulated data set are DEG. Under Study 2,
the $\alpha_1,\dots,\alpha_{10,000}\iid \text{Beta}(0.3,0.3)/2$.
  Under Study 3, for each gene, the $\alpha'$s are set according to the DESeq estimates. The simulated means of the 240 differentially expressed genes are shown schematically in Table \ref{table:means}. 

For the 9760 not differentially expressed genes, we used the means estimated by DESeq. 
%Under Study 2 the  overdispersion parameters are equal to zero with probability $1/2$ and Unif($0,0.4$) otherwise. 
For each gene $\alpha_i$ is the same in both treatments.
 Under Study 3, the $\alpha'$s  are set equal to their DESeq estimate. Finally, we estimate the abundances according to the algorithm in DESeq given in \eqref{libsize} and select the genes with highest posterior probabilities.

\begin{table}[]
\caption{\label{table:means} \textsc{\small Schematic representation of the simulated sample means. Here $q_p$ represents the
quantile $p$ of the 9760 genes selected at random from the Drosophila data of Section \ref{sec:application}.  The pattern of means given for the first $120$ genes is repeated in genes $121-240$.
Under Study 2, $\alpha_1,\dots,\alpha_{10,000}\iid \text{Beta}(0.3,0.3)/2$.
Under Study 3 the $\a'$ fulfill the DESeq assumptions explained in the text.}}
%\textcolor{red}{See program simulatingforC.r}
\begin{center}
\begin{tabular}{|c|cc|}
\multicolumn{1}{c}{Gene Index}&\multicolumn{2}{c}{Mean}\\
\hline
&&\vspace{-.1in}\\
&\multicolumn{1}{c}{Treatment 1}&Treatment 2\\
\hline
&&\vspace{-.1in}\\
$1-3$&$q_{0.10}$&$2q_{0.10}$\\
%2&$q_{0.10}$&$2q_{0.10}$\\
%3&$q_{0.10}$&$2q_{0.10}$\\
$4-6$&$q_{0.10}$&$q_{0.10}/2$\\
%5&$q_{0.10}$&$q_{0.10}/2$\\
%6&$q_{0.10}$&$q_{0.10}/2$\\
\hline
$7-9$&$q_{0.10}$&$3q_{0.10}$\\
%8&$q_{0.10}$&$3q_{0.10}$\\
%9&$q_{0.10}$&$3q_{0.10}$\\
$10-12$&$q_{0.10}$&$q_{0.10}/3$\\
%11&$q_{0.10}$&$q_{0.10}/3$\\
%12&$q_{0.10}$&$q_{0.10}/3$\\
\hline
$13-18$&$q_{0.20}$&$2q_{0.20}$\\
%14&$q_{0.20}$&$2q_{0.20}$\\
%$\vdots$\\
$19-24$&$q_{0.20}$&$q_{0.20}/2$\\
\hline
$25-96$&$\vdots$ &$\vdots$\\%q_{0.30}$&$2q_{0.30}$\\
%$\vdots$\\
\hline
$97-102$&$q_{0.95}$&$2q_{0.90}$\\
%$\vdots$\\
$103-108$&$q_{0.95}$&$q_{0.90}/2$\\
\hline
$109-114$&$q_{0.95}$&$3q_{0.95}$\\
%$\vdots$\\
$115-120$&$q_{0.95}$&$q_{0.95}/3$\\
\hline
%121	&$\cdots$\\
%$\vdots$& \multicolumn{2}{c}{As above}\\
%240&$\cdots$ \\
\end{tabular}
\end{center}
\end{table}

\begin{figure}[t]
%Dataset name dataforC_drosophilasimlowfoldsinDEG generated w simulatingforC.R
%Figure generated with Analyzing_sims.R 
\caption{\label{fig:BMFvsDESeq_combo_Csimulationalpha_exp_v_50_p1nonrandom} \textsc{\small 
Comparison of ROC and FDP curves of different procedures under scenario 2 
($\alpha_i\iid\text{Beta}(0.3,0.3)/2$, $\tilde{\pi}_1=0.0275$ with simulation true $\pi_1=0.024$). The numbers in parentheses correspond to the Area Under the curves (AUC).
}}
%\textcolor{red}{See P:Combo in program BayesFmodel\_dros\_Csimulation.r}
%\hspace{-.15in}\begin{array}{rl}
%\includegraphics[width=3in, height=3in,angle=270]{\plotpath/BMFvsDESeq_combo_Csimulationalpha_exp_v_50_p1nonrandom.eps}\\
%\includegraphics[width=2.75in,height=3.25in,angle=270]{\plotpath/truemus_ngenes10000_dataforC_drosophilasimlowfoldsinDEG.eps}
\includegraphics[width=2.75in,height=3.25in,angle=270]{ROCs_ngenes10000_favoringImutruealphabetad3d3.eps}
\includegraphics[width=2.75in,height=3.25in,angle=270]{FDR_ngenes10000_favoringImutruealphabetad3d3.eps}
%\\
%\end{array}
%$$
\end{figure}

\begin{figure}[]
%Dataset name favoringDESeq generated w  simulatingforCfavoringDESeq
%Figure generated with Analyzing_sims.R 
\caption{\label{fig:BMFvsDESeq_combo_Csimulationalpha_exp_v_50_p1nonrandomfavoringDESeq} 
\textsc{\small Comparison of ROC and FDR curves of different procedures under scenario 3 
($\alpha_i$ is a function of $\mu_i$ and $\alpha_i$ happens to be less than $0.07$, 
$\tilde{\pi_1}=0.0108$ with simulation true $\pi_1=0.024$). The numbers in parentheses correspond to the Area Under the curves (AUC).
  }}
%\includegraphics[width=2.75in,height=3.25in,angle=270]{\plotpath truemus_ngenes10000_favoringDESeq.eps}
\includegraphics[width=2.75in,height=3.25in,angle=270]{ROCs_ngenes10000_favoringDEseq.eps}
\includegraphics[width=2.75in,height=3.25in,angle=270]{FDR_ngenes10000_favoringDEseq.eps}
\end{figure}

%%\subsubsection{Simulation Results}
%For Studies 2 and 3, in \eqref{twocompetingmodel} we  set the hyperparameter values: 
%$a_\mu=0.01$. 
%%$P(H_{i1})=0.10$ (reflecting the percentage of genes that we would \textit{a priori} expect to be DEG)  
%%and $v_0=v_1=50$ assuming \textit{a priori} that the overdispersion parameter $\a$ is small.
%We estimate the abundance according to \eqref{libsize}.  

Figure  \ref{fig:BMFvsDESeq_combo_Csimulationalpha_exp_v_50_p1nonrandom} compares the results from the Bayes model (BM) with those of DESeq, A\&D, edgeR and baySeq under Study 2. In terms of the ROC curve, all the procedures have a similar behavior with the exception of baySeq
which offers a substantially lower tradeoff between the true positive and false positive proportions, which is expected in this simulation scenario. In terms of FDP (right panel), we observe that BM is competitive with A\&D and baySeq and they all perform better that DESeq in the range of genes that are differentially expressed.

%The right panel of Figure \ref{fig:BMFvsDESeq_combo_Csimulationalpha_exp_v_50_p1nonrandom} is  a comparison of the true FDP (solid lines calculated from the simulations) and the reported FDP (estimated). We see that the FDP is not well controlled by the Benjamin and Hochberg procedure when using the p-values reported by DESeq.  For example when reporting the 200 genes with lowest p-values as DEG, \todo{This statement may be true in an old figure but not the case now!! We need to think this!} \hl{DESeq reports an FDP less than 
% 0.05 while the true FDP is larger than 0.4.} The Bayesian model expected FDP performs well here, and gives a reasonable upper bound.  The \cite{Auer:Doerge:2010} procedure also has a reasonable FDP, %but the Benjamin and Hochberg procedure does not do a good job of controlling it, given an underestimation of the error. 
%baySeq also has a large discrepancy, underreporting the FDP.

Finally, Figure \ref{fig:BMFvsDESeq_combo_Csimulationalpha_exp_v_50_p1nonrandomfavoringDESeq} summarizes the results on Study 3. Even though the simulations were set to favor DESeq, we observe that the proposed Bayes model remains quite competitive to other alternatives in terms of ROC curves (left panel) and false discoveries (right panel), particularly within range of genes differentially expressed, where the true FDP does not exceed 20\% for 200 selected genes.

%In addition, DESeq computes a bound for the frequentist FDR according to the Benjamin and Hochberg procedure.  This bound indeed bounds the true FDR (calculated from the simulation). In contrast the $E(FDR\mid data)$ underestimates the true FDR when selecting genes according to \eqref{twocompetingmodel}. 

%Figure \ref{fig:BMFvsDESeq_combo_Csimulationalpha_exp_v_50_p1nonrandomfavoringDESeq} compares the results under Study 3, where we recall that the simulation is set up so that all of the DESeq assumptions are satisfied.   Here DESeq outperforms the other two methods but the Bayesian method remains quite competitive.



 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Application}\label{sec:application}
%\textcolor{red}{See preparinglaurensdataforC.r}\\
\begin{figure}[t]
\caption{\label{figure:realdatafigs}\textsc{\small For the RNA-Seq data described in Section \ref{sec:application}, the left panel shows the posterior expected FDP as a function of the number of genes declared DEG. The horizontal line marks FDP=0.05, yielding a selection of 362 genes.  The right panel shows $\log_2 (\hat{\mu}_{2i}/\hat{\mu}_{1i})$ vs the posterior probability of $H_{1i}$, where $\hat{\mu}_{1i}$ and $\hat{\mu}_{2i}$ are the estimated mean counts for the female and male flies respectively. The points representing flagged as DEG are above the discontinuous horizontal line. }}
%\textcolor{red}{See r program Bayes\_analysis\_Drosophila\_realdata.r} 
%\begin{center}$$
%\hspace{-.15in}\begin{array}{rl}
\includegraphics[width=2.75in,height=3.25in,angle=270]{BMrealdata_genes_selected_vs_FDR.eps}
\includegraphics[width=2.75in,height=3.25in,angle=270]{BMrealdata_volcanoplot.eps}
%\multicolumn{1}{c}{(a)}&\multicolumn{1}{c}{(b)}\\
%\includegraphics[width=2.5in, height=2.5in,angle=270]{\plotpath/BMrealdata_mu1vsmu2mu1ratio.eps}&
%\includegraphics[width=2.5in, height=2.5in,angle=90]{\plotpath/BMrealdata_mu1vsmu2_DEG.eps}\\
%\multicolumn{1}{c}{(c)}&\multicolumn{1}{c}{(d)}\\
%\end{array}$$
%\end{center}
\end{figure}
In order to illustrate the methodology, e compare the  expression of brain cells in females vs. male flies ({\it Drosophila Melanogaster}) in terms of exons, that, for the sake of the example, we will indistinctively call genes. In the experiment, six bottles of flies were used; $J_1=3$ bottles of female flies and $J_2=3$ of male flies. For every bottle we extract two samples of fly brains  and sequence them obtaining two technical  replications per bottle.  For every exon we consider one  count per bottle  by summing the counts over the two technical replications. Initially, 60277 genes were sequenced, and were pre-processed by the experimenter (removing genes with total sum of read counts less than or equal to 5) resulting in 48944 genes. 
We estimated the abundances according to equation \eqref{libsize} yielding
$\hat{s}_1=0.9378078$, 
$\hat{s}_2=0.9101029$, 
$\hat{s}_3=0.8255321$,
$\hat{s}_4=1.1126044$,
$\hat{s}_5=1.1928032$, and 
$\hat{s}_6=1.1221106$.

We tested the hypotheses in \eqref{twocompetingmodel}, with hyperparameter values set as described in Section \ref{sec:testing} yielding $u_0= 0.437, u_1= 0.411, v_0= 1.568$ and $v_1= 1.640$.


We also estimated the means by
$\hat{\mu}_{i1}=(1/J_1) \sum_{j=1}^{J_1}  k_{ij}/s_j$ and 
$\hat{\mu}_{i2}=(1/J_2) \sum_{j=J_1+1}^{J_1+J_2} k_{ij}/s_j$.
The estimated proportion of exons differentially expressed is $\tilde{\pi}_1=0.04$.
The left panel in Figure \ref{figure:realdatafigs} shows the posterior expected FDP as a function
of the number of selected genes.  Considering an $E(FDP\mid data)$=0.05 we declare 362 DEG. 
These genes have posterior probabilities $H_{1i}$ 
greater than $0.78$.   In the left panel we show a volcano plot comparing the $\log_2 (\hat{\mu}_{2i}/\hat{\mu}_{1i})$ with the posterior probability of being a DEG, where $\hat{\mu}_{1i}$ are the males flies and $\hat{\mu}_{2i}$ are the females flies. We observe that most DEG are overexpressed in the female flies. 

We also analyze the data using DESeq, baySeq, edgeR and A\&D, remember that our approach used the same library sizes as DESeq. To implement A\&D we also used these library sizes.  
For baySeq and edge R the library sizes were estimated 
by the R function \texttt{getLibsizes} in the \texttt{baySeq} package, and
by the R function \texttt{calcNormFactors} in the \texttt{edgeR} package, respectively.

%NUMBERS ON THIS PARAGRAPH COMPUTED USING 
For comparison we consider the top 362 selected by these procedures.
The reported FDPs are 
0.05,%BM  
$1.589095\times 10^{-6}$,%Deseq   
$8.445714\times 10^{-6}$,%baySeq
$4.086\times 10^{-9}$,%EdgeR
and
$7.504545\times 10^{-2}$%A&D 
 for the BM, DESeq, baySeq, edgeR and A\&D, respectively.  Two Venn diagrams of 
these genes are shown in the left panels  of Figure \ref{figure:venn}.
We also fixed the estimated FDR equal to 0.05 for the five methods
BM, DESeq and baySeq, endR and A\&D report 362, 1544, 1434,
2722 and 127 DEG, respectively. 
The Venn diagrams for these genes are shown in the right panels of Figure \ref{figure:venn}.

\begin{figure}[!htb]
\caption{\label{figure:venn}\textsc{\small 
Venn diagrams of the top 362 genes selected by BM, DESeq, baySeq (top left)
by BM edgeR and A\&D (bottom left)
and of the DEG reported by these methods when requiring a FDR of 0.05 (right).
  }}
%See r program Bayes\_analysis\_Drosophila\_realdata.r->project venn for
%the top diagrams and Project: vs Auer and Doerge and edgeR for the bottom programs
%%\begin{center}$$
%\hspace{-.15in}
$\begin{array}{rl}
\includegraphics[height=3in,angle=270]{venn.eps}&
\includegraphics[height=3in,angle=270]{vennfixedFDR.eps}\\
\includegraphics[height=3in,angle=270]{venn_EdgeRAuerDoerge.eps}&
\includegraphics[height=3in,angle=270]{vennfixedFDR_EdgeRAuerDoerge.eps}
\end{array}$
%%\end{center}
\end{figure}

%\begin{figure}[t]
%\caption{\label{figure:venn}\textsc{\small 
%Volcano plot of the  top 362 genes selected by BM, DESeq and baySeq. The 
%top 362 genes flagged as DEG by BM are above the horizontal discontinuous line,
%the 362 flagged by DESeq are represented by *
%and the 362 flagged by
%baySeq are blue.
%\textcolor{red}{Claudio: I do not know if this figure is useful. But i leave it there for your consideration. It is not referred in the text
%    }}}
%%See r program Bayes\_analysis\_Drosophila\_realdata.r->project: Comparing the results with the ones of DESeq 
%%%\begin{center}$$
%%\hspace{-.15in}
%\includegraphics[width=2.75in,height=3.25in,angle=270]{\plotpath/BMrealdata_volcanoplotwithbaySeq.eps}
%%%\end{center}
%\end{figure}

\section{Discussion}\label{sec:disc}

% Although our model does not require to have library of equal sizes, it is convenient (for numerical resosn) that the abundances are approximately proportional and close to 1
In this paper, we first proposed a new estimator of the overdispersion parameter of the negative binomial distribution, obtained via maximization of the marginal likelihood of a conjugate Bayesian model. We showed, using simulation results, that the marginalized MLE, outperforms the standard MLE and the quasilikelihood estimator in \cite{Robinson:Smyth:2008} in terms of MSE, offering a more accurate and stable estimator. The results are particularly promising in small sample scenarios. We then extended the idea behind this estimator for the analysis of RNA-Seq data when only a few counts per gene are available.  Specifically, we used a Bayesian framework to develop a hypothesis test to detect DEG. Our approach, which does not assume any functional relation between the overdispersion parameter and the mean (a standard assumption of other approaches such as DESeq), implicitly considers the marginal distribution of the model in Section \ref{sec:overdispersion}, and therefore, enjoys the same stability properties as the marginal MLE.

Because the inference is carried out gene by gene, our method enjoys of a borrowing-of-strength effect across genes at the level of the prior distribution of the overdispersion parameter $\alpha$.  Furthermore, the Bayesian framework we considered here is flexible and a number of extensions are possible. For instance, although the chosen prior is a gamma distribution with parameters depending on the initial estimates of $\alpha_i$, we could instead assume  that all $\alpha_i$'s come from an underlying prior distribution and make inference considering all genes simultaneously.  Such extensions are not explored in this paper, as a different computing approach would be required.
 %Our approach assumes  that the overdispersion parameter $\a$, in the negative binomial modeling of the counts, is \textit{a priori} small.  
 %The counts in RNA-Seq data typically have a large range.  Negative binomial counts have large variance if either the mean or the overdispersion parameter is large.
 %Small sample sizes make difficult for the model to  differentiate between the situation of large $\mu$ and  small $\a$ from the situation of small $\mu$ and large $\a$.  Our \textit{a priori} distribution on $\a$ gives more weight to the former situation.
Unlike other methods, our model imposes fewer assumptions about the number of counts, library sizes and mean-variance relationship. For instance, DESeq assumes that genes with similar mean counts have similar variances. Despite of the fewer assumptions, we showed via simulation studies that our approach remains competitive when compared to DESeq, baySeq, A\&D and edgeR and sometimes performs better than some of the alternatives (in terms of ROC curves and proportion of false discoveries), even in situations designed to favor the competitors.

The proposed model flags genes with the highest Bayes factors as DEG. To accomplish this, we do not require  \textit{a priori} specification of the proportion $\pi_1$ of DEG.  However,  in order to estimate both the posterior probability of a gene being a DEG and  the FDP the method does requires a value for $\pi_1$. To estimate $\pi_1$ we follow the approach by \cite{wen2013robust}, which has proven to produce very accurate estimates of the true FDP in a number of scenarios and perform better than the FDP reported by other methods in a number of cases.
%There is not an automatic way to set this value but, as we suspect that most genes are not differentially expressed, we typically set this value to be small.  (We assume that most genes ``keep the house in order'' and only a few  have a different behavior under the treatment.)
%The necessity of fixing hyperparameter values is inherent to any Bayesian approach.

Finally, the simple Bayesian hierarchical structure of our method make the model easy to interpret and implement to analyze real data sets using standard MCMC techniques. The Gibbs sampler algorithm we include in the Appendix compute the Bayes factors of interest within a few minutes and allows for modifications and extensions to further tailor to the dataset and question of interest.  %Our procedure is competitive with the more complicated DESeq and baySeq procedures, which use the data to estimate the underlying structure and then fit the model with these estimated parameters.  
Software is available from the authors upon request.  

\section*{Acknowledgments}
The authors would like to thank Dr. Lauren McIntyre from the University of Florida for facilitating the data set used in this work and for her insightful comments and suggestions.
%\bch
%In summary we have proposed a new estimator for the overdispersion parameter of the negative binomial distribution better in terms of MSE than the MLE. Based on it, we have proposed a Bayesian  hypothesis test to detect DEG's in RNA-Seq data sets.
%\ech

\bibliographystyle{apalike}
%\bibliographystyle{biom}
\bibliography{bibliography_NB}

\appendix
%\section{Appendix}
\section{Estimating $P(H_{1i})$ for the unequal abundance case}\label{app:gibbs}
We omit the gene index $i$ of the notation.
We can approximate the Bayes factor in favor of model $H_1$ with the harmonic mean estimator \citep{newton1994approximate}, %\note{Newton and Raftery, 1994}
\begin{equation*}
BF_{10}\approx \sum_{m=1}^M {1/\ell_0(\mu_0^{(m)},\alpha_0^{(m)};\kv)}\Bigg/    \sum_{m=1}^M {1/\ell_1(\mu_1^{(m)},\mu_2^{(m)},\alpha_1^{(m)};\kv)},
\end{equation*}%Remember that $r$ is the indicator of the true hypothesis, that is, $r=0$ when $H_0$ is true and $r=1$ otherwise. 
where
\begin{equation*}
\ell_0(\mu_0,\alpha_0;\kv) =\prod_j \text{NegBin}(k_j\mid \mu_0,\a_0)
\end{equation*}
and
\begin{equation*}
\begin{array}{rl}
\ell_1(\mu_1,\mu_2,\alpha_1;\kv)=& \prod_{j=1}^{J_1} \text{NegBin}(k_j\mid \mu_1,\a_1)\\
&\times\prod_{j=J_1+1}^{J_1+J_2} \text{NegBin}(k_j\mid \mu_2,\a_1)
\end{array}
\end{equation*}
are the likelihoods under $H_0$ and $H_1$ respectively, and $\gamma^{(m)}$ denotes the $m$-th random number generated from
the posterior distribution  of the generic parameter $\gamma$. 
These random numbers  can be obtained running two Gibbs samplers (one under $H_0$ and one under $H_1$),

%It is well known that the  harmonic mean estimator does not give good estimates of the BF in practice.\note{Actually, we are using the harmonic mean but if we got crazy results we could try to improve the computation of the Bayes Factor by using the approximation described below but i do not know if the  improve (if any) is relevant}
%So we propose to compute the BF using a sample from the larger model in $H_1$,
%\begin{equation*}
%BF_{10}\approx \frac{1}{2}
%\sum_{m=1}^M\left( {\ell_0(\mu_1^{(m)},\alpha_1^{(m)};\kv)}
%+\ell_0(\mu_2^{(m)},\alpha_1^{(m)};\kv)
%\right)
%\Bigg/    \sum_{m=1}^M {1/\ell_1(\mu_1^{(m)},\mu_2^{(m)},\alpha_1^{(m)};\kv)},
%\end{equation*}
%where $(\mu_1^{(m)},\mu_2^{(m)},\alpha_1^{(m)})$ denotes the $m$-th random number generated from the posterior distribution under 
%model $H_1$. \note{I have the proof of this and now we only require to have a posterior sample from the large model. I need to use the same prior in alpha though, ire the same values of u and v}

%Below we give the Gibbs sampler scheme. \note{The numbers are as if we were using the exponential distribution and not the gamma distribution. I need to update this}
The full conditional distribution under $H_0$ is
\begin{equation*}
\begin{array}{rl}
p(\mu_0,\a_0 \mid \kv)\propto&
\ell_0(\mu_0,\alpha_0;\kv)\times \text{F}(\mu_0\mid 2 a_\mu, 2 a_\mu/\alpha_0) \times\text{gamma}(\alpha_0\mid u_0,v_0)\\
=&
\prod_j\left[\frac{1}{{\cal B}(k_j+1,\a_0^{-1})(k_j+\a_0^{-1})}
\frac{(\a_0 s_j\mu_0)^{k_j}}{(\a_0 s_j\mu_0+1)^{k_j+1/\a_0}}
\right]\\
\times&\frac{1}{{\cal B}(a_\mu,a_\mu/\a_0)}
\frac{\a_0^{a_\mu}\mu_0^{a_\mu-1}  }{(1+\a_0\mu_0)^{(1+1/\a_0)a_\mu}}
\times \alpha_0^{u_0-1}v_0 \exp(-v_0 \alpha_0)\\
\end{array}
\end{equation*}
and under $H_1$,
\begin{equation*}
\begin{array}{rl}
p(\mu_1,\mu_2,\a_1  \mid\kv)\propto&
\ell_1(\mu_1,\mu2,\alpha_1;\kv)\times \text{F}(\mu_1\mid 2 a_\mu, 2 a_\mu/\alpha_1) 
\times \text{F}(\mu_2\mid 2 a_\mu, 2 a_\mu/\alpha_1)
\times\text{gamma}(\alpha_1\mid u_1,v_1)\\
\times&\prod_{j=1}^{J_1+J_2}\left[\frac{1}{{\cal B}(k_j+1,\a_1^{-1})(k_j+\a_1^{-1})}\right]\\
\times&\left[
\prod_{j=1}^{J_1}
\frac{(\a_1 s_j\mu_1)^{k_j}}{(\a_1 s_j\mu_1+1)^{k_j+1/\a_1}}
\right]\times
\left[ \prod_{j=J_1+1}^{J_1+J_2}
\frac{(\a_1 s_j\mu_2)^{k_j}}{(\a_1 s_j\mu_2+1)^{k_j+1/\a_1}}
\right]\\
\times&\frac{1}{{\cal B}^2(a_\mu,a_\mu/\a_1)}
\frac{\a_1^{a_\mu}\mu_1^{a_\mu-1}  }{(1+\a_1\mu_0)^{(1+1/\a_1)a_\mu}}
\times
\frac{\a_1^{a_\mu}\mu_2^{a_\mu-1}  }{(1+\a_1\mu_0)^{(1+1/\a_1)a_\mu}}
\times \alpha_1^{u_1-1} v_1 \exp(-v_1 \alpha_1)\\
\end{array}
\end{equation*}


%Denoting % $\kv,\mu_0,\mu_1,\mu_2,\a_0,\a_1$ 
%as $all$ all the parameters different from the .
The complete conditional distributions for the Gibbs sampler (we denote as $all$ all the conditioning parameters) is given by
\begin{equation*}
p(\mu_i\mid all)\propto \frac{\mu^{\sum_j k_j+a_\mu-1}    }{\prod_j (1+\a s_j\mu_i)^{k_j+1/\a}}
\frac{1}{(1+\a\mu_i)^{a_\mu+a_\mu/\a}}
\end{equation*}
where $k_{\cdot}=\sum_{j} k_j$, the indices in this sum and the product in the equation above depend on  which $\mu$ is being generated.  For $\mu_0,\mu_1$ and $\mu_2$, the index $j$ runs over $1,\dots,J_1+J2$, $1,\dots,J_1$ and $J_1+1,\dots,J_1+J_2$ respectively. Also 
 $\a=\a_0$ when generating $\mu_0$ while $\a=\a_1$  when generating $\mu_1$ and $\mu_2$.  A good starting point for the Gibbs sampler is the average of $ k_j/s_j$. 
 
The Gibbs sampler can be implemented in two different ways. The first one is through a Metropolis-Hastings (MH) random walk with proposal distribution $N(\mu^t,\sigma_\mu^2)$, where $\sigma_\mu^2$ is set equal to the sample variance of $k_j/s_j$. %, or, say 0.1, when this variance is zero. 
The second, generating $\mu^{t+1}$ by a MH algorithm  that uses as candidate the posterior distribution of $\mu$, if all the abundances were 1. Such distribution is an F- distribution. The MH algorithm %to simulate from $p(\mu\mid all)$
is: 

\begin{enumerate}
\item Generate $\mu^\prime\sim \text{F}\left(2(a_\mu+\sum_j k_j),2(J+a_\mu)/\a\right)$
\item Set $\mu^c=\mu^\prime\times (a_\mu+\sum_j k_j)/(J+a_\mu)$
\item Set $\mu^{t+1}=\mu^c$ with probability $\min\{1,\exp(\beta)\}$ with
\begin{equation*}
\beta = \sum_j(k_{j}+1/\a)\log\left[ \frac{1+\a s_j\mu^t}{1+\a s_j\mu^c}\right]+(\sum_j k_j+J/\a)\log\left[\frac{1+\a\mu^c}{1+\a\mu^t} \right]
\end{equation*}
Here $J$ is $J_1+J_2$, $J_1$ or $J_2$ when generating $\mu_0,\mu_1$ or $\mu_2$ respectively. 
\end{enumerate}

We simulate $\a_0$ and $\a_1$ via MH. The $\log$ of the complete posterior distributions, up to additive constants not depending on $\a$, are given by 
\begin{equation*}
\begin{array}{rl}
\log p(\a_0\mid all)=&
-\sum_{j=1}^{J_1+J_2}\left[
\log {\cal B}(k_{j}+1,\a_0^{-1})+\log(k_{j}+\a_0^{-1})\right]\\
&+\left[a_\mu+\sum_{j=1}^{J_1+J_2} k_j \right]\log \a_0 \\
&-\sum_{j=1}^{J_1+J_2}(k_j+\a_0^{-1}) \log(\a_0\mu_0 s_j+1)\\
&-\log {\cal B}(a_\mu,a_\mu/\a_0)-a_\mu(1+\a_0^{-1})\log(1+\a_0\mu_0) \\
&+(u_0-1)\log(\alpha_0)-v_0 \a_0,
\end{array}
\end{equation*}

\begin{equation*}
\begin{array}{rl}
\log p(\a_1\mid all)=&
-\sum_{j=1}^{J_1+J_2}\left[
\log {\cal B}(k_{j}+1,\a_1^{-1})+\log(k_{j}+\a_1^{-1})\right]\\
&+\left[2 a_\mu+\sum_{j=1}^{J_1+J_2} k_j \right]\log \a_1 \\
&-\sum_{j=1}^{J_1}(k_j+\a_1^{-1}) \log(\a_1\mu_1 s_j+1)-\sum_{j=J_1+1}^{J_1+J_2}(k_j+\a_1^{-1}) \log(\a_1\mu_2 s_j+1)\\
&-2 \log {\cal B}(a_\mu,a_\mu/\a_1)-a_\mu(1+\a_1^{-1})\left[\log(1+\a_1\mu_1)+\log(1+\a_1\mu_2)\right] \\
&+(u_1-1)\log(\alpha_1)-v_1 \a_1.
\end{array}
\end{equation*}
%Let $r=0$ if $H_{0}$ is true and 1 if $H_1$ is true. 
%Then
%$$
%p(r=0\mid all)=p(\kv\mid r=0,\mu_0,\a_0) P(H_0)/q,
%$$
%and
%$$
%p_1:=p(r=1\mid all)=p(\kv\mid r=1,\mu_1,\mu_2,\a_1) P(H_1)/q,
%$$
%where $q$ is a normalizing constant, that is, $q>0$ is such that $p(r=0\mid all)+p(r=1\mid all)=1$.
%The log of the expressions above reduce to
%\begin{eqnarray*}
%\log p(r=0\mid all)&=&\log p(\a_0\mid all)+\left[a_\mu-1+\sum_{j=1}^{J_1+J2}k_j\right]\log \mu_0+log(v_0)\\
%&&+(1-P(H_1))-\log q\\
%\log p(r=1\mid all)&=&\log p(\a_1\mid all)+	\left[a_\mu-1+\sum_{j=1}^{J_1}\right]\log \mu_1\\
%&&+\left[a_\mu-1+\sum_{j=J_1}^{J_1+J_2}k_j\right]\log \mu_2+log(v_1)+P(H_1)-\log q.
%\end{eqnarray*}

%Once we have a Gibbs sample of $p_1$: $p_1^1,\dots,p_1^M$;  
%the ergodic theorem implies that
%$$
%(1/M)\sum_{m=1}^M p_1^m\to_{M\to\infty} E(p_1\mid\kv)= P(H_1\mid \text{data}),
%$$
%that is we estimate $P(H_1\mid\text{data})$ with the average of the $p_1^m$'s.

%\subsection{Simulation strategy}\label{app:strategy}
%
%%Here we describe how the data were simulated for Studies $2$ and $3$ of Section \ref{sec:study2-3}.  The difference is the way we set the overdispersion parameters ($\alpha$'s), described in points 7 and 8 below. Recall that DESeq assumes that genes with similar means have similar overdispersion parameters, that is,
%%if $\mu_i\approx \mu_j$ then $\alpha_i\approx\a_j$. Under Study 2 the true $\alpha'$s for the simulation do not satisfy this DESeq assumption. Under Study 3 this assumption is fulfilled. 
%
%For the simulation studies $2$ and $3$ in Section \ref{sec:study2-3} we considered the following scheme:
%\begin{table}[t]
%\caption{\label{table:means} \textsc{\small Schematic representation of the simulated sample means. Here $q_p$ represents the
%quantile $p$ of the 9760 genes selected at random from the Drosophila data of Section \ref{sec:application}.  The pattern of means given for the first $120$ genes is repeated in genes $121-240$.
%Under Study 2 the first 120 $\a's$ are zero and the the second 120 $\a'$ are equal to 0.2.
%Under Study 3 the $\a'$ fulfill the DESeq assumptions explained in the text.}}
%%\textcolor{red}{See program simulatingforC.r}
%\begin{center}
%\begin{tabular}{|c|cc|}
%\multicolumn{1}{c}{Gene Index}&\multicolumn{2}{c}{Mean}\\
%\hline
%&&\vspace{-.1in}\\
%&\multicolumn{1}{c}{Treatment 1}&Treatment 2\\
%\hline
%&&\vspace{-.1in}\\
%$1-3$&$q_{0.10}$&$2q_{0.10}$\\
%%2&$q_{0.10}$&$2q_{0.10}$\\
%%3&$q_{0.10}$&$2q_{0.10}$\\
%$4-6$&$q_{0.10}$&$q_{0.10}/2$\\
%%5&$q_{0.10}$&$q_{0.10}/2$\\
%%6&$q_{0.10}$&$q_{0.10}/2$\\
%\hline
%$7-9$&$q_{0.10}$&$3q_{0.10}$\\
%%8&$q_{0.10}$&$3q_{0.10}$\\
%%9&$q_{0.10}$&$3q_{0.10}$\\
%$10-12$&$q_{0.10}$&$q_{0.10}/3$\\
%%11&$q_{0.10}$&$q_{0.10}/3$\\
%%12&$q_{0.10}$&$q_{0.10}/3$\\
%\hline
%$13-18$&$q_{0.20}$&$2q_{0.20}$\\
%%14&$q_{0.20}$&$2q_{0.20}$\\
%%$\vdots$\\
%$19-24$&$q_{0.20}$&$q_{0.20}/3$\\
%\hline
%$25-96$&$\vdots$ &$\vdots$\\%q_{0.30}$&$2q_{0.30}$\\
%%$\vdots$\\
%\hline
%$97-102$&$q_{0.90}$&$2q_{0.90}$\\
%%$\vdots$\\
%$103-108$&$q_{0.90}$&$q_{0.90}/3$\\
%\hline
%$109-114$&$q_{0.95}$&$2q_{0.95}$\\
%%$\vdots$\\
%$115-120$&$q_{0.95}$&$q_{0.95}/3$\\
%\hline
%%121	&$\cdots$\\
%%$\vdots$& \multicolumn{2}{c}{As above}\\
%%240&$\cdots$ \\
%\end{tabular}
%
%\end{center}
%\end{table}
%
%\begin{enumerate}
%\item Simulated a dataset with ten  thousand genes, six individuals and two treatments.
%\item The values for the simulation parameters were set based on
% the Drosophila data described in Section \ref{sec:application}. %Only females individuals and summing over technical replications.
%From those genes whose estimated mean (estimated by DESeq) is greater than ten we randomly selected 9,760 genes.
%\item We considered three individuals in \emph{Treatment 1} and three in \emph{Treatment 2}; $i.e.$ $J_1=J_2=3$.
%\item We estimated the means of these 9,760 counts, adjusting for library abundance, using DESeq and  compute the empirical deciles: $q_{0.1},\dots,q_{0.9}$ and the quantile $q_{0.95}$.
%%Figure \ref{fig:histforCsimuDrosophila}shows a histogram of the 9,760 estimated means.
%\item  Only the first 240 genes in the simulated data set are DEG. The simulated means of the DEG  240 genes are shown schematically
%in Table \ref{table:means}. 
%\item For the simulation, we fix the true abundances equal to $0.8 (=s_1=s_4)$, $1 (=s_2=s_5)$ and $1.2(=s_3=s_6)$ in both treatments.
%\item For the 9760 non DEG, we use the estimated means ($\mu's$) estimated by DESeq. Under Study 2 
%%the first  4910
%the  overdispersion ($\a's$) parameters are equal to zero with probability $1/2$ and  
% Unif($0,0.4$) otherwise. For each gene $\a_i$ is the same in both treatments.
% Under Study 3, the $\alpha'$s  are set equal to their DESeq estimate. %The $\alpha_i$ is different in each treatment. All $\alpha'$s are between 0 and 0.3.
% %Under the DESeq procedure greater the estimation of $\mu$ the lower the estimated value of $\alpha$. 
%\item Under Study 2, the first 120 genes are simulated from a Poisson (that is, $\a=0$) and genes 121-240 from negative binomial samples with overdispersion parameter equal to 0.2. 
%Under Study 3, for each gene, the $\alpha'$s are set according to the DESeq%. More specifically, DESeq estimates the means (base mean) $\mu_i$ and variances $v_i$ (RawVariance) for each gene, and performs the local regression $v_i\sim \mu_i$ and treats the adjusted $v_i$, $v_i^{DESeq}$, as true in its analysis.
%estimates the means (baseMean) $\mu_i$ and variances $v_i$ (RawVariance). Then we set $\a_i= (v_i^{DESeq}-\mu_i)/\mu_i^2$.
%%\bch 
%%\item Under $beta$-scenario 4 I will simulate $\alpha\sim Unif(0,0.7)$ and instead of using folds of
%%2 and 3. I will use folds of $1.2$ and $1.5$.
%% \ech
%  %the files corresponding to the beta scenario are in folder dataforC_drosophilasimlowfoldsinDEG
%
%\item We estimate the abundances according to the algorithm in DESeq given in \eqref{libsize}
%and select the genes with highest posterior probabilities.
%%\item \textcolor{red}{see program BayesFmodel\_dros\_Csimulation} for the analysis of the outcome.
%\end{enumerate}



\end{document}





\begin{thebibliography}{}

\bibitem[Anders and Huber, 2010]{Anders:Huber:2010}
Anders, S. and Huber, W. (2010).
\newblock Differential expression analysis for sequence count data.
\newblock {\em Genome Biology}, 11(10):R106.

\bibitem[Auer and Doerge, 2010]{Auer:Doerge:2010}
Auer, P.~L. and Doerge, R.~W. (2010).
\newblock Statistical design and analysis of {RNA} sequencing data.
\newblock {\em Genetics}, 185(2):405--416.

\bibitem[Benjamini and Hochberg, 1995]{Benjamini:Hochberg:1995}
Benjamini, Y. and Hochberg, Y. (1995).
\newblock Controlling the false discovery rate: A practical and powerful
  approach to multiple testing.
\newblock {\em Journal of the Royal Statistical Society. Series B
  (Methodological)}, 57(1):pp. 289--300.

\bibitem[Carroll and Lombard, 1985]{carroll:lombard:1985}
Carroll, R.~J. and Lombard, F. (1985).
\newblock A note on n estimators for the binomial distribution.
\newblock {\em Journal of the American Statistical Association}, 80(390):pp.
  423--426.

\bibitem[Chen et~al., 2014]{chenetal:2014}
Chen, Y., Lun, A., and Smyth, G. (2014).
\newblock Differential expression analysis of complex rna-seq experiments using
  edge{R}.
\newblock In Datta, S. and Nettleton, D.~S., editors, {\em Statistical Analysis
  of Next Generation Sequence Data}. Springer, New York.

\bibitem[Di et~al., 2011]{di2011nbp}
Di, Y., Schafer, D.~W., Cumbie, J.~S., and Chang, J.~H. (2011).
\newblock The nbp negative binomial model for assessing differential gene
  expression from rna-seq.
\newblock {\em Statistical Applications in Genetics and Molecular Biology},
  10(1):1--28.

\bibitem[Feng et~al., 2010]{Feng2010}
Feng, J., Li, W., and Jiang, T. (2010).
\newblock Inference of isoforms from short sequence reads.
\newblock {\em Lect. Notes Comput Sci.}, 6044:138Ð157.

\bibitem[Graze et~al., 2012]{graze2012allelic}
Graze, R., Novelo, L., Amin, V., Fear, J., Casella, G., Nuzhdin, S., and
  McIntyre, L. (2012).
\newblock Allelic imbalance in drosophila hybrid heads: exons, isoforms, and
  evolution.
\newblock {\em Molecular biology and evolution}, 29(6):1521--1532.

\bibitem[Hardcastle and Kelly, 2010]{hardcastle:kelly:2010}
Hardcastle, T. and Kelly, K. (2010).
\newblock bayseq: Empirical bayesian methods for identifying differential
  expression in sequence count data.
\newblock {\em BMC Bioinformatics}, 11(1):422.

\bibitem[Law et~al., 2014]{law2014voom}
Law, C.~W., Chen, Y., Shi, W., and Smyth, G.~K. (2014).
\newblock voom: precision weights unlock linear model analysis tools for
  rna-seq read counts.
\newblock {\em Genome Biology}, 15(2):R29.

\bibitem[Newton et~al., 2004]{Newton:2004}
Newton, M.~A., Noueiry, A., Sarkar, D., and Ahlquist, P. (2004).
\newblock Detecting differential gene expression with a semiparametric
  hierarchical mixture method.
\newblock {\em Biostatistics}, 5(2):155--176.

\bibitem[Newton and Raftery, 1994]{newton1994approximate}
Newton, M.~A. and Raftery, A.~E. (1994).
\newblock Approximate bayesian inference with the weighted likelihood
  bootstrap.
\newblock {\em Journal of the Royal Statistical Society. Series B
  (Methodological)}, pages 3--48.

\bibitem[Olkin et~al., 1981]{olkinm:petkau:videk1981}
Olkin, I., Petkau, A.~J., and Zidek, J.~V. (1981).
\newblock A comparison of n estimators for the binomial distribution.
\newblock {\em Journal of the American Statistical Association}, 76(375):pp.
  637--642.

\bibitem[Rapaport et~al., 2013]{rapaport2013comprehensive}
Rapaport, F., Khanin, R., Liang, Y., Pirun, M., Krek, A., Zumbo, P., Mason,
  C.~E., Socci, N.~D., and Betel, D. (2013).
\newblock Comprehensive evaluation of differential gene expression analysis
  methods for rna-seq data.
\newblock {\em Genome biology}, 14(9):R95.

\bibitem[Robinson et~al., 2010]{Robinson01012010}
Robinson, M.~D., McCarthy, D.~J., and Smyth, G.~K. (2010).
\newblock edger: a bioconductor package for differential expression analysis of
  digital gene expression data.
\newblock {\em Bioinformatics}, 26(1):139--140.

\bibitem[Robinson and Smyth, 2007]{Robinson01112007}
Robinson, M.~D. and Smyth, G.~K. (2007).
\newblock Moderated statistical tests for assessing differences in tag
  abundance.
\newblock {\em Bioinformatics}, 23(21):2881--2887.

\bibitem[Robinson and Smyth, 2008]{Robinson:Smyth:2008}
Robinson, M.~D. and Smyth, G.~K. (2008).
\newblock Small-sample estimation of negative binomial dispersion, with
  applications to sage data.
\newblock {\em Biostatistics}, 9(2):321--332.

\bibitem[Salzman et~al., 2011]{salzman2011statistical}
Salzman, J., Jiang, H., and Wong, W.~H. (2011).
\newblock Statistical modeling of rna-seq data.
\newblock {\em Statistical Science}, 26(1):62--83.

\bibitem[Smyth, 2005]{smyth2005limma}
Smyth, G.~K. (2005).
\newblock Limma: linear models for microarray data.
\newblock In {\em Bioinformatics and computational biology solutions using R
  and Bioconductor}, pages 397--420. Springer.

\bibitem[Wen, 2013]{wen2013robust}
Wen, X. (2013).
\newblock Robust bayesian fdr control with bayes factors.
\newblock {\em arXiv preprint arXiv:1311.3981}.

\bibitem[Wu et~al., 2013]{wu2013new}
Wu, H., Wang, C., and Wu, Z. (2013).
\newblock A new shrinkage estimator for dispersion improves differential
  expression detection in rna-seq data.
\newblock {\em Biostatistics}, 14(2):232--243.

\bibitem[Zhou et~al., 2011]{zhou2011beta}
Zhou, M., Hannah, L., Dunson, D., and Carin, L. (2011).
\newblock Beta-negative binomial process and poisson factor analysis.
\newblock {\em arXiv preprint arXiv:1112.3605}.

\end{thebibliography}