# Optimal Tests for Combining \(p\)-Values
## 2 Methods
### Constrained Likelihood Ratio Tests
#### 2.3.2 The Optimal CLRT-Based Test When \(\alpha\) Is Unknown  
When both parameters \(\alpha\) and \(c\) in (8) are unknown, they need to be estimated via the constrained MLEs, from which the following constrained likelihood ratio test is defined:  
\[T_{CLRT}(P_{1},\cdots,P_{n})=2\hat{\alpha}_{CLRT}nln(1-\hat{c}_{CLRT})+2(\hat{ c}_{CLRT})\sum_{i=1}^{n}F_{G(\hat{c}_{CLRT})}^{-1}(1-P_{i}) \tag{11}\]  
where \(\hat{\alpha}_{CLRT}\) and \(\hat{c}_{CLRT}\) are the constrained MLEs for parameters \(\alpha\) and \(c\), respectively, through maximizing the log-likelihood function \(l(\alpha,c)=naln(1-c)+c\sum_{i=1}^{n}F_{G(a)}^{-1}(1-P_{i})\) with the constrains \(0<c<1\) and \(\alpha>0\). The R function \"nlminb\" can be applied to find the constrained MLEs and the corresponding test statistic. The proposed test was implemented using R; the R package \"opt\" (optimal \(p\)-value combination test) can be freely download from [[https://github.com/zchen2020/opt](https://github.com/zchen2020/opt)]([https://github.com/zchen2020/opt](https://github.com/zchen2020/opt)) (accessed on 15 November 2021).  
For the above CLRT-based test \(T_{CLRT}\), similar to Proposition 4, we have the following result [30]:  
**Proposition 6**.: _The asymptotic distribution of the test \(T_{CLRT}\) is a mixture of chi-square distributions \(\sum_{i=0}^{2}w_{i}\chi_{i}^{2}\), where \(\chi_{i}^{2}\) is the chi-square distribution with \(df=i\), \(\chi_{0}^{2}\) is the random variable with probability 1 of being 0, and the weights \(w_{0}\), \(w_{1}\), \(w_{2}\) are determined by the null and the alternative hypothesis._The above asymptotic result may not be directly applicable to estimate the \(p\)-value for this test, as the number of \(p\)-values \(n\) is usually small, and more seriously, the weights \(w_{i}\)'s are difficult to obtain. Instead, a simple resampling method can be used to approximate the null distribution and to estimate the \(p\)-value of \(T_{CLRT}\). More specifically, for given sample size \(n\), randomly sample \(n\) null \(p\)-values evenly distributed between 0 and 1, then calculate the test statistic using (10). Repeat this process many times (e.g., \(10^{5}\)); then, the empirical distribution of the test statistic can be used to approximate the null distribution and therefore the \(p\)-value of \(T_{CLRT}\).  
Similar to Theorem 4, we have the following result for \(T_{CLRT}\):  
Theorem 5: _Under the conditions specified in (8), the CLRT-based test \(T_{CLRT}\) is asymptotically UMP._  
Proof: Under conditions (8), it can be shown that the constrained MLEs for \(\alpha\) and \(c\) are consistent (see, for instance, Theorem 1 of Self and [PERSON] [30]). Hence, \(T_{CLRT}\) is asymptotically equivalent to \(T_{CLRT,\alpha_{0}}\) for known \(\alpha=\alpha_{0}\) in (8). Then from Theorem 4, \(T_{CLRT}\) is asymptotically UMP. \(\square\)  
Remark 2: (_i_) When \(\alpha=\alpha_{0}\) is known, compared with test \(T_{CLRT,\alpha_{0}}\), the test \(T_{G(\alpha_{0})}\) is preferred because (a) its test statistic and \(p\)-value are easier to get and (b) the two tests in general have very similar performances. (_ii_) When both \(\alpha\) and \(c\) are unknown, the test \(T_{CLRT}\) is asymptotically UMP, while, in general, neither \(T_{CLRT,\alpha_{0}}\) nor \(T_{G(\alpha_{0})}\) for preset \(\alpha=\alpha_{0}\) is UMP or asymptotically UMP. Therefore, it is expected that \(T_{CLRT}\) is more robust, and overall, it has better performance than each individual gamma distribution-based test \(T_{G(\alpha)}\), including the existing popular ones described in Sections 2.1.1-2.1.4.