Supplementary material (Proofs and R Codes) to Two-sample density-based empirical likelihood ratio tests based on paired data, with application to a treatment study of Attention-Deficit/Hyperactivity Disorder and Severe Mood Dysregulation Albert Vexlera*†, Wan-Min Tsaia, Gregory Gurevichb and Jihnhee Yuaο S1: Appendix A1. Proof of proposition 1 A1.1 Proposed test 1 Consider the case of testing π»0 vs. π»π΄1 (π‘ = 1) in Proposition 1. Towards this end, we define π 1 ππ∗1 π = ∑π=1 [log (π 2π 1 ππ,π ) + log (1 − π+1 2π1 π 2 )] , ππ∗∗2π = ∑π=1 [log (π 2π 2 ππ,π π+1 ) + log (1 − 2π )]. 2 (A1.1.1) π» Then the proposed test statistic at (9), (π1 + π2 )−1 log(ππ1π΄1 π2 ), can be expressed as π» (π1 + π2 )−1 log(ππ1π΄1 π2 ) = min π1 0.5+δ ≤π≤π1 1−δ π2 )−1 ππ∗∗2 π . (π1 + π2 )−1 ππ∗1π + min π2 0.5+δ ≤π≤π2 1−δ (π1 + (A1.1.2) We first investigate the first term of the right-hand side of the equation (A1.1.2). To this end, we define the distribution function π(π₯) to be π(π₯) = (π1 πΉ1 (π₯) + π2 πΉ2 (π₯))⁄(π1 + π2 ), where πΉ1 (π₯) = (πΉπ1 (π₯) + 1 − πΉπ1 (−π₯))⁄2 and πΉ2 (π₯) = (πΉπ2 (π₯) + 1 − πΉπ2 (−π₯))⁄2. a Department of Biostatisics, The State University of New York, Buffalo, NY 14214, U.S.A. The Department of Industrial Engineering and Management, SCE- Shamoon College of Engineering, Beer-Sheva 84100, Israel * Correspondence to: Albert Vexler, Department of Biostatisics, The State University of New York, Buffalo, NY 14214, U.S.A. † Email: avexler@buffalo.edu b 1 Also, an empirical distribution function is defined by πΊπ1 +π2 (π₯) = (π1 πΊπ1 (π₯) + π2 πΊπ2 (π₯))⁄(π1 + π2 ), where π1 πΊπ1 (π₯) = (π1 −1 π1 ∑ πΌ(π1π ≤ π₯) + π1 −1 ∑ πΌ(−π1π ≤ π₯))⁄2 π=1 π=1 π2 π2 and πΊπ2 (π₯) = (π2 −1 ∑ πΌ(π2π ≤ π₯) + π2 −1 ∑ πΌ(−π2π ≤ π₯))⁄2 π=1 π=1 are the empirical distribution functions based on observations π11 , … , π1π1 and π21 , … , π2π2 , respectively. Consequently, the first term of ππ∗1π in (A1.1.1) can be reformulated as π π π=1 π=1 1 1 π1 [πΊπ1 +π2 (π1 (π+π) ) − πΊπ1 +π2 (π1 (π−π) )] 1 2π 1 ∑ log ( )=− ∑ log ( ) π1 + π2 π1 ππ,π π1 + π2 2π π 1 π (π1 (π+π) ) − π (π1 (π−π) ) 1 =− ∑ log ( ) π1 + π2 πΉ (π ) − πΉ (π ) 1 π=1 π1 −π 1 1 +π2 1 1 (π−π) π (π1 (π+π) ) − π (π1 (π−π) ) 1 + ∑ log ( π1 + π2 πΊ π=1 1 (π+π) ) (π ) − πΊ (π ) π1 +π2 1 (π+π) π1 +π2 1 (π−π) π1 [πΉ1 (π1 (π+π) )−πΉ1 (π1 (π−π) )] 1 ∑ππ=1 πππ ( 2π ). (A1.1.3) The first term in the right-hand of the equation (A1.1.3) can be expressed as π π 1 1 π (π1 (π+π) ) − π (π1 (π−π) ) π (π1 (π+π) ) − π (π1 (π−π) ) 1 1 ∑ log ( )= ∑ log ( ) π1 + π2 π1 + π2 π1 (π+π) − π1 (π−π) πΉ (π ) − πΉ (π ) 1 π=1 −π 1 (π+π) 1 1 (π−π) π=1 πΉ1 (π1 (π+π) )−πΉ1 (π1 (π−π) ) 1 1 +π2 1 ∑ππ=1 log ( π1 (π+π) −π1 (π−π) ). (A1.1.4) The result shown in Theorem 1 of Vasicek [29] leads to 1 π1 +π2 1 ∑ππ=1 log ( π(π1 (π+π) )−π(π1 (π−π) ) π1 (π+π) −π1 (π−π) 2 )=π π1 1 1 +π2 2π ∑2π π=1 ππ , (A1.1.5) where π 1 ππ = ∑π=1 log ( π(π1 (π+π) )−π(π1 (π−π) ) π1 (π+π) −π1 (π−π) ) (πΉ1 (π1 (π+π) ) − πΉ1 (π1 (π−π) )) , π ≡ π (mod 2m). Let ππ (π₯) = ππΉπ (π₯)⁄ππ₯ = (πππ (π₯) + πππ (−π₯))⁄2 , π = 1, 2. Suppose π1 (π−π) and π1 (π+π) is within an interval in which π(π₯) = ππ(π₯)⁄ππ₯ = π1 π1 (π₯)⁄(π1 + π2 ) + π2 π2 (π₯)⁄(π1 + π2 ) is positive and continuous, then π(ππ′ ) = π (π1 (π+π) ) − π (π1 (π−π) ) π1 (π+π) − π1 (π−π) , for some existing value ππ′ ∈ (π1 (π−π) , π1 (π+π) ). (The assumption that π(π₯) is positive and continuous, when π₯ ∈ (π1 (π−π) , π1 (π+π) ), is used to simplify the proof and this condition can be excluded, for example, see the proof scheme applied in [29].) It follows that ππ can be written as π 1 ππ = ∑π=1 log(π(ππ′ )) (πΉ1 (π1 (π+π) ) − πΉ1 (π1 (π−π) )) , π ≡ π (mod 2m). Let us define a density function πΜ (π₯) that approximates π(π₯) as follows: πΜ (π₯) = πΎπ1 (π₯)⁄(1 + πΎ) + π2 (π₯)⁄(1 + πΎ). For each π > 0 and sufficiently large π1 and π2 , π1 ⁄π2 → πΎ so that we have (1 − π)πΜ (π₯) ≤ π(π₯) ≤ (1 + π)πΜ (π₯). It follows that for sufficiently large π1 and π2 , ππ,(−π) ≤ ππ ≤ ππ,π , π 1 where ππ,(−π) = ∑π=1 log((1 − π)πΜ (ππ′ )) (πΉ1 (π1 (π+π) ) − πΉ1 (π1 (π−π) )), π 1 and ππ,π = ∑π=1 log((1 + π)πΜ (ππ′ )) (πΉ1 (π1 (π+π) ) − πΉ1 (π1 (π−π) )). i.e. ππ,(−π) and ππ,π are Stieltjes sums of the function log((1 − π)πΜ (π11 )) and log((1 + π)πΜ (π11 )), respectively, with respect to the measure πΉ1 over the sum of intervals of continuity of π1 (π₯) and π2 (π₯) in which πΜ (π₯) > 0. Since in any interval in which πΜ (π₯) is positive, π1 (π+π) − π1 (π−π) → 0 as π1 → ∞ uniformly over π ∈ ∞ [π1 0.5+πΏ , π11−πΏ ], δ ∈ (0,1/4), and uniformly over π1 , ππ,(−π) converges in probability to ∫−∞ log ((1 − 3 π)πΜ (π11 )) ππ(π11 ) = πΈ{log((1 − π)πΜ (π11 ))} as π1 → ∞. Furthermore, this convergence is uniformly over j and π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0,1/4). Similarly, ππ,π converges in probability to πΈ{log((1 + π)πΜ (π11 ))}, uniformly over j and π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0,1/4). Therefore, 2π 1 πΈ{log((1 − π)πΜ (π11 ))} ≤ ∑ ππ‘ ≤ πΈ{log((1 + π)πΜ (π11 ))}, 2π π‘=1 as π1 → ∞, uniformly over π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0,1/4). Recalling from (A1.1.5), we find π(π1 (π+π) )−π(π1 (π−π) ) π 1 (π1 + π2 )−1 ∑π=1 log ( π1 (π+π) −π1 (π−π) π πΎ ) → 1+πΎ πΈ{log(πΜ (π11 ))}, (A1.1.6) as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0, uniformly over π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0,1/4). Similarly, we have πΉ1 (π1 (π+π) )−πΉ1 (π1 (π−π) ) π 1 (π1 + π2 )−1 ∑π=1 log ( π1 (π+π) −π1 (π−π) π πΎ ) → 1+πΎ πΈ{log(π1 (π11 ))}, (A1.1.7) as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0, uniformly over π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0, 1/4). Combining the results of (A1.1.4), (A1.1.6), and (A1.1.7) yields π1 π (π1 (π+π) ) − π (π1 (π−π) ) (π1 + π2 )−1 ∑ log ( ) πΉ1 (π1 (π+π) ) − πΉ1 (π1 (π−π) ) π=1 π πΜ (π ) πΎ πΎ πΎ 1 π (π ) → 1+πΎ πΈ (log (π (π11 ))) = 1+πΎ πΈ log {1+πΎ + 1+πΎ (π2 (π11 ))}, 1 11 1 11 (A1.1.8) as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0, uniformly over π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0, 1/4). Now, we consider the second term in the right-hand side of the equation (A1.1.3). By Theorem A in Serfling [31], we know that for 0 ≤ π ≤ πΏ/2, π1 →∞ Pr ( sup |πΉ1 (π₯) − πΉπ1 (π₯)| > π1 −0.5+π ) → 0, −∞<π₯<∞ and π2 →∞ Pr ( sup |πΉ2 (π₯) − πΉπ2 (π₯)| > π2 −0.5+π ) → −∞<π₯<∞ 4 0, π1 →∞,π2 →∞,π1 ⁄π2 →πΎ implying that Pr ( sup |πΉ2 (π₯) − πΉπ2 (π₯)| > (2π1 /πΎ)−0.5+π ) → 0. −∞<π₯<∞ π1 →∞,π2 →∞ Hence, Pr ( sup |π(π₯) − πΊπ1 +π2 (π₯)| > π1 −0.5+2π ) → 0, for 0 ≤ π ≤ πΏ/2. −∞<π₯<∞ Now we consider the case when sup |π(π₯) − πΊπ1 +π2 (π₯)| ≤ π1 −0.5+2π . According to the definition of −∞<π₯<∞ πΊπ1 +π2 (π₯), we have the inequality πΊπ1 +π2 (π1 (π+π) ) − πΊπ1 +π2 (π1 (π−π) ) ≥ π1 (π1 + π2 )−1 2π(π1 )−1 = 2π/(π1 + π2 ). Thus, for the case of sup |π(π₯) − πΊπ1 +π2 (π₯)| ≤ π1 −0.5+2π , we have −∞<π₯<∞ π1 1 ∑ log ( π1 + π2 πΊ π (π1 (π+π) ) − π (π1 (π−π) ) π1 +π2 (π1 (π+π) ) − πΊπ1 +π2 (π1 (π−π) ) π=1 ) π 1 πΊπ1 +π2 (π1 (π+π) ) − πΊπ1 +π2 (π1 (π−π) ) + π1 −0.5+πΏ/2 1 ≤ ∑ log ( ) π1 + π2 πΊ (π )−πΊ (π ) π=1 π1 +π2 1 (π+π) π1 +π2 πΏ π1 1 (π−π) π1 1 π1 −0.5+2 1 π1 −0.5+πΏ/2 1 ≤ ∑ log (1 + )≤ ∑( )= → 0, 0.5+πΏ π1 + π2 2π/(π1 + π2 ) π1 + π2 2π1 /(π1 + π2 ) 2π1 πΏ/2 π=1 π=1 for a sufficiently large π1 and π ∈ [π1 0.5+πΏ , π11−πΏ ]. Also, note that π1 π (π1 (π+π) ) − π (π1 (π−π) ) 1 ∑ log ( π1 + π2 πΊ π=1 π1 +π2 (π1 (π+π) ) − πΊπ1 +π2 (π1 (π−π) ) ) π 1 πΊπ1 +π2 (π1 (π+π) ) − πΊπ1 +π2 (π1 (π−π) ) − π1 −0.5+πΏ/2 1 ≥ ∑ log ( ) π1 + π2 πΊ (π )−πΊ (π ) π=1 π1 π1 +π2 1 (π+π) π1 +π2 πΏ 1 (π−π) π1 1 π1 −0.5+2 1 2π1 −0.5+πΏ/2 1 ≥ ∑ log (1 − ) ≥− ∑( ) = − πΏ/2 → 0, 0.5+πΏ π1 + π2 2π/(π1 + π2 ) π1 + π2 π1 2π1 /(π1 + π2 ) π=1 π=1 5 for a sufficiently large π1 and π ∈ [π1 0.5+πΏ , π11−πΏ ]. Hence, we prove that the second term in the right-hand side of the equality (A1.1.3) converges to zero in probability. That is, 1 π1 +π2 π π(π1 (π+π) )−π(π1 (π−π) ) 1 ∑ππ=1 log ( πΊπ1 +π2 (π1 (π+π) )−πΊπ1 +π2 (π1 (π−π) ) ) → 0, (A1.1.9) as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0, uniformly over π1 0.5+δ ≤ π ≤ π11−δ . Finally, using the result of Lemma 1 of Vasicek [29], the last term in the right-hand side of the equality of (A1.1.3) also converges to zero in probability. That is, π1 [πΉ1 (π1 (π+π) )−πΉ1 (π1 (π−π) )] π 1 −(π1 + π2 )−1 ∑π=1 log ( 2π π ) → 0, (A1.1.10) as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0, uniformly over π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0,1/4). By (A1.1.8), (A1.1.9), and (A1.1.10), we show that π (π1 + π2 )−1 ππ∗1 π → − πΎ 1+πΎ πΎ 1 π (π ) πΈ log {1+πΎ + 1+πΎ (π2 (π11 ))}, 1 11 as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0, uniformly over π1 0.5+δ ≤ π ≤ π11−δ , δ ∈ (0, 1/4). Likewise, following the same procedure as shown in the proof of ππ∗1 π , we have π2 (π1 + π2 )−1 ππ∗∗2 π = (π1 + π2 )−1 ∑ [log ( π=1 − 2π π+1 π ) + log (1 − )] → π2 ππ,π 2π2 1 πΎ π1 (π21 ) 1 πΈ log { ( )+ }, 1+πΎ 1 + πΎ π2 (π21 ) 1+πΎ as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0, uniformly over π2 0.5+δ ≤ π ≤ π21−δ , δ ∈ (0,1/4). This and (A1.1.11) conclude that π π» (π1 + π2 )−1 log(ππ1π΄1 π2 ) → − − πΎ πΎ 1 π2 (π11 ) πΈ log { + ( )} 1+πΎ 1 + πΎ 1 + πΎ π1 (π11 ) 1 πΎ π1 (π21 ) 1 πΈ log { ( )+ }, 1+πΎ 1 + πΎ π2 (π21 ) 1+πΎ as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0. Hence, under π»0 , 6 (A1.1.11) π2 (π11 ) (ππ2 (π11 ) + ππ2 (−π11 ))⁄2 ππ2 (π11 ) = = , π1 (π11 ) (π (π ) + π (−π ))⁄2 ππ1 (π11 ) π1 11 π1 11 π1 (π21 ) (ππ1 (π21 ) + ππ1 (−π21 ))⁄2 ππ1 (π21 ) = = , π2 (π21 ) (π (π ) + π (−π ))⁄2 ππ2 (π21 ) π2 21 π2 π π» (π1 + π2 )−1 log(ππ1π΄1 π2 ) → − − 21 ππ (π11 ) πΎ πΎ 1 πΈπ»0 log { + ( 2 )} 1+πΎ 1 + πΎ 1 + πΎ ππ1 (π11 ) ππ (π21 ) 1 πΎ 1 πΈπ»0 log { ( 1 )+ } = 0, 1+πΎ 1 + πΎ ππ2 (π21 ) 1+πΎ and under π»π΄1 , π» π (π1 + π2 )−1 log(ππ1π΄1 π2 ) → − − ≥− πΎ πΎ 1 π2 (π11 ) πΈπ»π΄1 log { + ( )} 1+πΎ 1 + πΎ 1 + πΎ π1 (π11 ) 1 πΎ π1 (π21 ) 1 πΈπ»π΄1 log { ( )+ } 1+πΎ 1 + πΎ π2 (π21 ) 1+πΎ πΎ πΎ 1 π2 (π11 ) 1 πΎ π1 (π21 ) 1 log { + πΈπ»π΄1 ( )} − log { πΈπ»π΄1 ( )+ } 1+πΎ 1+πΎ 1+πΎ π1 (π11 ) 1+πΎ 1+πΎ π2 (π21 ) 1+πΎ ≥ 0, as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0. We complete the proof of Proposition 1 for the case of π‘ = 1, i.e. the consistency related to the proposed Test 1. A1.2 Proposed test 2 Here, we will consider the case of π‘ = 2. That is, we will show that π» π (π1 + π2 )−1 log(ππ1π΄2 π2 ) → − − πΎ πΎ 1 π2 (π11 ) πΈ log { + ( )} 1+πΎ 1 + πΎ 1 + πΎ π1 (π11 ) 1 πΎ π1 (π21 ) 1 πΈ log { ( )+ }, 1+πΎ 1 + πΎ π2 (π21 ) 1+πΎ as π1 → ∞, π2 → ∞, π1 ⁄π2 → πΎ > 0. π It is clear that if one can show that log(π¬ππ2 ) → 0 as π2 → ∞, where π¬ππ2 is defined by (12), the rest of the proof π» is similar to the proof shown in Section A1.1 regarding the test statistic of the proposed Test 1, log(ππ1π΄1 π2 ). To consider log(π¬ππ2 ), as π2 → ∞, we begin with a proof that 7 π2 1 πΉΜπ2 (π2 (π2 ) ) − πΉΜπ2 (π2 (1) ) = ∑ [πΌ (π2π ≤ π2 (π2 ) ) + πΌ (−π2π ≤ π2 (π2 ) )] 2π2 π=1 π2 − π 1 ∑ [πΌ (π2π ≤ π2 (1) ) + πΌ (−π2π ≤ π2 (1) )] → 1, as π2 → ∞. 2π2 π=1 To this end, we apply Theorem A of Serfling [31], having that for π ∈ (0, 1/2), sup |πΉΜπ2 (π’) − πΉπ2 (π’)| = π(π2 −0.5+π ) as π2 → ∞. −∞<π’<∞ Thus, πΉΜπ2 (π2 (π2 ) ) − πΉΜπ2 (π2 (1) ) = πΉπ2 (π2 (π2 ) ) − πΉπ2 (π2 (1) ) + π(π2 −0.5+π ). It is obvious that πΉπ2 (π2 (π2 ) ) → 1 and πΉπ2 (π2 (1) ) → 0 as π2 → ∞. Hence, π πΉΜπ2 (π2 (π2 ) ) − πΉΜπ2 (π2 (1) ) → 1 as π2 → ∞. (A1.2.1) π π2 −1 Μ Μ Next, we will show that the part of π¬ππ2 , ∑π−1 π=1 (2π) (π − π) ∑π=1 [πΉπ2 (π2 (π+1) ) − πΉπ2 (π2 (π) )] → 0 as π2 → ∞. Let πΉΜ−π2 (π’) denote the empirical distribution function of −π2 distributed with (1 − πΉπ2 (−π’)) (Here the symmetry of Z2 distribution under π»0 and π»π΄2 is used). Then π−1 ∑ π=1 (π − π) [πΉΜπ2 (π2 (π+1) ) − πΉΜπ2 (π2 (π) )] 2π π−1 π2 π=1 π=1 (π − π) 1 = ∑ ∑ [πΌ (π2π ≤ π2 (π+1) ) + πΌ (−π2π ≤ π2 (π+1) ) − πΌ (π2π ≤ π2 (π) ) − πΌ (−π2π ≤ π2 (π) )] 2π2 2π = (π−π) 4π2 + ∑π−1 π=1 (π−π) 2π [πΉΜ−π2 (π2 (π+1) ) − πΉΜ−π2 (π2 (π) )]. (A1.2.2) Since the first term of (A1.2.2), (4π2 )−1 (π − π), vanishes to zero as π2 → ∞, we focus on the remaining terms of the equation (A1.2.2), which can be reorganized as follows: π−1 π−1 π=1 π=1 (π − π) (π − (π − 1)) π ∑ [πΉΜ−π2 (π2 (π+1) ) − πΉΜ−π2 (π2 (π) )] = ∑ πΉΜ−π2 (π2 (π) ) − πΉΜ (π ) 2π 2π 2π −π2 2 (1) π−1 (π − π) (π − (π − 1)) + πΉΜ−π2 (π2 (π) ) − ∑ πΉΜ−π2 (π2 (π) ) 2π 2π π=1 1 1 1 Μ Μ Μ = 2π ∑π−1 π=1 πΉ−π2 (π2 (π) ) − 2 πΉ−π2 (π2 (1) ) + 2π πΉ−π2 (π2 (π) ). 8 (A1.2.3) In respect to the empirical distribution function, πΉΜ−π2 (π’), appeared in (A1.2.3), again by virtue of Theorem A of Serfling [31], we have that for π ∈ (0, 1/2), π−1 ∑ π=1 1 (π − π) [πΉΜ−π2 (π2 (π+1) ) − πΉΜ−π2 (π2 (π) )] 2π 1 1 −0.5+π ). = 2π ∑π−1 π=1 πΉ−π2 (π2 (π) ) − 2 πΉ−π2 (π2 (1) ) + 2π πΉ−π2 (π2 (π) ) + π(π2 (A1.2.4) Clearly, πΉ−π2 (π2 (1) )⁄2 → 0 and πΉ−π2 (π2 (π) )⁄2π → 0 as π2 → ∞. Now, we prove that the first item of (A1.2.4) converges to zero in probability as π2 → ∞. Since the distribution of π21 , … , π2π2 is symmetric under π»0 and the statistic, π¬ππ2 , is based on πΌ (−π2π ≤ π2 (π) ) under π»0 and π»π΄2 , the distribution of π21 , … , π2π2 can be taken as the uniform distribution on the interval [-1, 1]. Thus, we obtain πΉ−π2 (π2 (π) ) = (1 + π2 (π) )⁄2, where π(π) = (1 + π2 (π) )⁄2 is the rth order statistic based on a standard uniformly distributed, Unif[0,1], random variable. Since π−1 πΈ {(2π)−1 ∑ π(π) } = π=1 π(π − 1) → 0, as π2 → ∞, 4π(π2 + 1) π applying the Chebyshev's inequality yields (2π)−1 ∑π−1 π=1 π(π) → 0 as π2 → ∞. Combining (A1.2.2)-( A1.2.4), we conclude that ∑π−1 π=1 (π−π) 2π π [πΉΜπ2 (π2 (π+1) ) − πΉΜπ2 (π2 (π) )] → 0 as π2 → ∞. (A1.2.5) Similarly, one can show that ∑π−1 π=1 (π−π) 2π π [πΉΜπ2 (π2 (π2 −π+1) ) − πΉΜπ2 (π2 (π2 −π) )] → 0 as π2 → ∞. (A1.2.6) π The results of (A1.2.1), (A1.2.5), and (A1.2.6) complete the proof of log(π¬ππ2 ) → 0 as π2 → ∞. A2. Mathematical derivation of maximum likelihood ratio tests A2.1 Maximum likelihood ratio test statistic for Test 1 Assume πππ ~π. π. π. π(πππ , ππ2π ), where πππ and ππ2π , π =1,2, are unknown. The following null hypothesis, π»0ππΏπ , is equivalent to the null hypothesis, π»0 , that presented in the article π»0ππΏπ : ππ1 = ππ2 = 0; ππ21 = ππ22 = π 2 . Hence, the corresponding hypothesis of interest for Test 1 using the maximum likelihood ratio test is π»0ππΏπ vs. π»1ππΏπ : not π»0ππΏπ . Under normal assumptions, the MLR test statistic is given by 9 π1 max ∏π=1 (2πππ21 ) ππΏπ π΄1 = −1⁄2 − ππ1 , ππ21 π (π1π −ππ1 )2 2ππ21 π2 max ∏π=1 (2πππ22 ) ππ2 , ππ22 2 π1π − 2 π1 ⁄ 2 −1 2 ∏π=1(2ππ ) max π 2π π2 = −1⁄2 − π (π2π −ππ2 )2 2ππ22 2 π2π − 2 π2 ⁄ 2 −1 2 ∏π=1(2ππ ) π 2π (2ππΜπ21 )−π1⁄2 (2ππΜπ22 )−π2⁄2 π −(π1 +π2 )⁄2 (2ππΜ 2 )−(π1 +π2 )⁄2 π −(π1 +π2 )⁄2 = (πΜπ21 )−π1⁄2 (πΜπ22 )−π2⁄2 (πΜ 2 )−(π1 +π2 )⁄2 , where the associated maximum likelihood estimators (MLEs) of ππ1 , ππ2 , ππ21 , ππ22 , and π 2 are πΜ π1 = π2 π1 π2 1 ∑ππ=1 π1π ⁄π1 = π1Μ , πΜ π2 = ∑π=1 π2π ⁄π2 = πΜ 2 , πΜπ21 = ∑π=1 (π1π − π1Μ )2⁄π1 , πΜπ22 = ∑π=1 (π2π − πΜ 2 )2⁄π2 , and π π πΜ 2 = ∑2π=1 ∑π=1 πππ 2 ⁄(π1 + π2 ), respectively. A2.2 Maximum likelihood ratio test statistic for Test 2 Under the assumption that πππ ~π. π. π. π(πππ , ππ2π ), where πππ and ππ2π , π =1,2, are unknown, the hypotheses π»0 vs. π»π΄2 are equivalent to the following hypotheses: π»0ππΏπ vs. π»π΄ππΏπ : ππ1 ≠ 0, ππ2 = 0; ππ21 ≠ ππ22 . 2 Thus, the maximum likelihood ratio for Test 2 can be formulated by π1 max ∏π=1 (2πππ21 ) ππΏπ π΄2 = −1⁄2 − ππ1 , ππ21 π (π1π −ππ1 )2 2ππ21 2 π1π − 2 π1 ⁄ 2 −1 2 ∏π=1(2ππ ) max π 2π π2 2 π2π − 2 ⁄ −1 2 2 ∏ππ=1 max (2πππ22 ) π 2ππ2 ππ22 2 π2π − 2 π2 ⁄ 2 −1 2 ∏π=1(2ππ ) π 2π . Substituting the associated MLEs of ππ1 , ππ21 , and π 2 into the above likelihood ratio, ππΏπ π΄2 , yields the following maximum likelihood ratio test statistic for Test 2: ππΏπ π΄2 = (πΜπ21 )−π1 ⁄2 (πΜπ22 )−π2 ⁄2 (πΜ 2 )(π1 +π2 )⁄2 π π π 2 1 1 2 ⁄π2 and πΜ 2 = where πΜ π1 = ∑π=1 π1π ⁄π1 = π1Μ , πΜπ21 = ∑π=1 (π1π − π1Μ )2⁄π1 , πΜπ22 = ∑π=1 π2π π ∑2π=1 ∑ππ=1 πππ 2 ⁄(π1 + π2 ). A2.3 Maximum likelihood ratio test statistic for the Test 3 Assume πππ ~π. π. π. π(πππ , ππ2π ), where πππ and ππ2π , π =1,2, are unknown. The hypotheses: π»0 vs. π»π΄3 are equivalent to the following hypotheses: π»0ππΏπ vs. π»π΄ππΏπ : ππ1 = ππ2 = π1 ≠ 0; ππ21 = ππ22 = π12 . 3 Accordingly, the corresponding MLR test statistic is 10 ππΏπ π΄3 = − π1 (2ππ12 )−1⁄2 π max2 ∏π=1 π1 ,π1 (π1π −π1 )2 2π12 2 π1π − π1 ∏π=1(2ππ 2 )−1⁄2 π 2π2 max π2 − 2 ∏ππ=1 (2ππ12 )−1⁄2 π (π2π −π1 )2 2π12 2 π2π − π2 ∏π=1(2ππ 2 )−1⁄2 π 2π2 . Replacing the parameters of π1 , π12 , and π 2 by their MLEs, the following maximum likelihood ratio test statistic for the Test 3 can be formulated by ππΏπ π΄3 = (πΜ12 ⁄πΜ 2 )−(π1 +π2 )⁄2 , ππ ππ where πΜ 1 = ∑2π=1 ∑π=1 πππ ⁄(π1 + π2 ) = πΜ , πΜ12 = ∑2π=1 ∑π=1 (πππ − πΜ )2⁄(π1 + π2 ), and πΜ 2 = π ∑2π=1 ∑ππ=1 πππ 2 ⁄(π1 + π2 ). S2: R Codes applied to the Monte Carlo Simulations. ################################### ############## Test 1 ############# ################################### #The next codes present computations of the test-1-statistic (9) # number of the Monte Carlo iterations k<-50000 # sample sizes n1<-10 n2<-10 # delta value used in the definitions (7) and (8) delta<-0.1 # Storage for the values of the proposed test statistic EntrF<-array() for(i in 1:k) { #generation of Sample 1 (paired data z1) z1<-rnorm(n1,0,1) #generation of Sample 2 (paired data z2) z2<-rnorm(n2,0,1) z<-c(z1,z2) # combination of the samples, called z sz1<-sort(z1) sz2<-sort(z2) sz<-sort(z) # sorting of the generated paired data z1 # sorting of the generated paired data z2 # sorting of the combined sample z # density-based test statistic (log of eq. (7)) based on Sample 1 (z1) 11 LogM<-array() # loop for each value of m for(m in round(n1^(delta+0.5)):min(c(round((n1)^(1-delta)),round(n1/2)))) { Log<-0 for(j in 1:n1) { D<-1*(j-m<1)+(j-m)*(j-m>=1) U<-n1*(j+m>n1)+(j+m)*(j+m<=n1) Uz<-length(sz[sz<=sz1[U]])+length(sz[-sz<=sz1[U]]) Dz<-length(sz[sz<=sz1[D]])+length(sz[-sz<=sz1[D]]) Delt<-(Uz-Dz)/(2*(n1+n2)) #Similarly to Canner (J.Am.Stat.Assoc. 70, 209-211(1975)), we will #arbitrarily define Delt=1/(n1+n2), if Uz=Dz if (Delt==0) Delt<-1/(n1+n2) Log<-Log-2*log(n1)-log(Delt)+log(m)+log(2*n1-m-1) } LogM[m-round(n1^(delta+0.5))+1]<-Log } EntrF[i]<-min(LogM) # density-based test statistic (log of eq. (8)) based on Sample 2 (z2) LogM<-array() for(m in round(n2^(delta+0.5)):min(c(round((n2)^(1-delta)),round(n2/2)))) # loop for each value of m { Log<-0 for(j in 1:n2) { D<-1*(j-m<1)+(j-m)*(j-m>=1) U<-n2*(j+m>n2)+(j+m)*(j+m<=n2) Uz<-length(sz[sz<=sz2[U]])+length(sz[-sz<=sz2[U]]) Dz<-length(sz[sz<=sz2[D]])+length(sz[-sz<=sz2[D]]) Delt<-(Uz-Dz)/(2*(n1+n2)) if (Delt==0) Delt<-1/(n1+n2) Log<-Log-2*log(n2)-log(Delt)+log(m)+log(2*n2-m-1) } LogM[m-round(n2^(delta+0.5))+1]<-Log } EntrF[i]<-min(LogM)+EntrF[i] # the proposed test statistic }#end of the MC repetitions ### Calculate critical values of the density-based EL test statistic (9) ### for Test 1 ##### quantile(EntrF, 0.99) # alpha=0.01 quantile(EntrF, 0.95) # alpha=0.05 quantile(EntrF, 0.9) # alpha=0.1 12 ################################### ############## Test 2 ############# ################################### #The next codes present computations of the test-2-statistic #based on arrays sz, sz1, sz2 mentioned above. #Density-based test statistic based on Sample 1 (log of eq. (10)) LogM<-array() for(m in round(n1^(delta+0.5)):min(c(round((n1)^(1-delta)),round(n1/2)))) #loop for each value of m { Log<-0 for(j in 1:n1) { D<-1*(j-m<1)+(j-m)*(j-m>=1) U<-n1*(j+m>n1)+(j+m)*(j+m<=n1) Uz<-length(sz[sz<=sz1[U]])+length(sz[-sz<=sz1[U]]) Dz<-length(sz[sz<=sz1[D]])+length(sz[-sz<=sz1[D]]) Delt<-(Uz-Dz)/(2*(n1+n2)) if (Delt==0) Delt<-1/(n1+n2) Log<-Log-2*log(n1)-log(Delt)+log(m)+log(2*n1-m-1) } LogM[m-round(n1^(delta+0.5))+1]<-Log } EntrF[i]<-min(LogM) #here “i” is Monte Carlo index #density-based test statistic based on Sample 2 LogM<-array() for(m in round(n2^(delta+0.5)):min(c(round((n2)^(1-delta)),round(n2/2)))) # loop for each value of m { Log<-0 for(j in 1:n2) { D<-1*(j-m<1)+(j-m)*(j-m>=1) U<-n2*(j+m>n2)+(j+m)*(j+m<=n2) Uz<-length(sz[sz<=sz2[U]])+length(sz[-sz<=sz2[U]]) Dz<-length(sz[sz<=sz2[D]])+length(sz[-sz<=sz2[D]]) Delt<-(Uz-Dz)/(2*(n1+n2)) if (Delt==0) Delt<-1/(n1+n2) d<-c() dd<-c() tuz<-length(sz2[-sz2<=sz2[n2]])-length(sz2[-sz2<=sz2[1]]) for (r in 1:m-1) { d[r]<-length(sz2[-sz2<=sz2[n2-r+1]])-length(sz2[-sz2<=sz2[n2r]])+length(sz2[-sz2<=sz2[r+1]])-length(sz2[-sz2<=sz2[r]]) dd[r]<-((m-r)/(2*m))*d[r] } tud<-sum(dd) a<-(tuz-tud+n2-1-(m-1)/2)/(2*n2) Log<-Log-log(n2)-log(Delt)+log(2)+log(m)+log(a) 13 } LogM[m-round(n2^(delta+0.5))+1]<-Log } #Test statistic at (15) EntrF[i]<-min(LogM)+EntrF[i] #here “i” is Monte Carlo index ################################### ############## Test 3 ############# ################################### #The next codes present computations of the test-3-statistic(log of (16)) N<-n1+n2 # total sample size LogM<-array() for(m in round(N^(delta+0.5)):min(c(round((N)^(1-delta)),round(N/2)))) { Log<-0 for(j in 1:N) { D<-1*(j-m<1)+(j-m)*(j-m>=1) U<-N*(j+m>N)+(j+m)*(j+m<=N) Uz<-length(sz[sz<=sz[U]])+length(sz[-sz<=sz[U]]) Dz<-length(sz[sz<=sz[D]])+length(sz[-sz<=sz[D]]) Delt<-(Uz-Dz)/(2*(n1+n2)) if (Delt==0) Delt<-1/(n1+n2) Log<-Log-2*log(N)-log(Delt)+log(m)+log(2*N-m-1) } LogM[m-round(N^(delta+0.5))+1]<-Log } EntrF[i]<-min(LogM) #here “i” is Monte Carlo index } 14