1515struct Bonferroni <: PValueAdjustment
1616end
1717
18- adjust (pValues:: PValues , method:: Bonferroni ) = adjust (pValues, length (pValues), method)
18+ adjust (pValues:: PValues{T} , method:: Bonferroni ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
1919
20- function adjust (pValues:: PValues , n:: Integer , method:: Bonferroni )
20+ function adjust (pValues:: PValues{T} , n:: Integer , method:: Bonferroni ) where T <: AbstractFloat
2121 k = length (pValues)
2222 check_number_tests (k, n)
2323 pAdjusted = clamp .(pValues * n, 0 , 1 )
3030struct BenjaminiHochberg <: PValueAdjustment
3131end
3232
33- adjust (pValues:: PValues , method:: BenjaminiHochberg ) = adjust (pValues, length (pValues), method)
33+ adjust (pValues:: PValues{T} , method:: BenjaminiHochberg ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
3434
35- function adjust (pValues:: PValues , n:: Integer , method:: BenjaminiHochberg )
35+ function adjust (pValues:: PValues{T} , n:: Integer , method:: BenjaminiHochberg ) where T <: AbstractFloat
3636 k = length (pValues)
3737 check_number_tests (k, n)
3838 if k <= 1
@@ -58,9 +58,9 @@ BenjaminiHochbergAdaptive(π0::AbstractFloat) = BenjaminiHochbergAdaptive(Oracle
5858
5959BenjaminiHochbergAdaptive () = BenjaminiHochbergAdaptive (1.0 )
6060
61- adjust (pValues:: PValues , method:: BenjaminiHochbergAdaptive ) = adjust (pValues, length (pValues), method)
61+ adjust (pValues:: PValues{T} , method:: BenjaminiHochbergAdaptive ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
6262
63- function adjust (pValues:: PValues , n:: Integer , method:: BenjaminiHochbergAdaptive )
63+ function adjust (pValues:: PValues{T} , n:: Integer , method:: BenjaminiHochbergAdaptive ) where T <: AbstractFloat
6464 π0 = estimate_pi0 (pValues, method. pi0estimator)
6565 pAdjusted = adjust (pValues, n, BenjaminiHochberg ()) * π0
6666 return pAdjusted
7272struct BenjaminiYekutieli <: PValueAdjustment
7373end
7474
75- adjust (pValues:: PValues , method:: BenjaminiYekutieli ) = adjust (pValues, length (pValues), method)
75+ adjust (pValues:: PValues{T} , method:: BenjaminiYekutieli ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
7676
77- function adjust (pValues:: PValues , n:: Integer , method:: BenjaminiYekutieli )
77+ function adjust (pValues:: PValues{T} , n:: Integer , method:: BenjaminiYekutieli ) where T <: AbstractFloat
7878 k = length (pValues)
7979 check_number_tests (k, n)
8080 if k <= 1
9494struct BenjaminiLiu <: PValueAdjustment
9595end
9696
97- adjust (pValues:: PValues , method:: BenjaminiLiu ) = adjust (pValues, length (pValues), method)
97+ adjust (pValues:: PValues{T} , method:: BenjaminiLiu ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
9898
99- function adjust (pValues:: PValues , n:: Integer , method:: BenjaminiLiu )
99+ function adjust (pValues:: PValues{T} , n:: Integer , method:: BenjaminiLiu ) where T <: AbstractFloat
100100 k = length (pValues)
101101 check_number_tests (k, n)
102102 if n <= 1
119119struct Hochberg <: PValueAdjustment
120120end
121121
122- adjust (pValues:: PValues , method:: Hochberg ) = adjust (pValues, length (pValues), method)
122+ adjust (pValues:: PValues{T} , method:: Hochberg ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
123123
124- function adjust (pValues:: PValues , n:: Integer , method:: Hochberg )
124+ function adjust (pValues:: PValues{T} , n:: Integer , method:: Hochberg ) where T <: AbstractFloat
125125 k = length (pValues)
126126 check_number_tests (k, n)
127127 if k <= 1
141141struct Holm <: PValueAdjustment
142142end
143143
144- adjust (pValues:: PValues , method:: Holm ) = adjust (pValues, length (pValues), method)
144+ adjust (pValues:: PValues{T} , method:: Holm ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
145145
146- function adjust (pValues:: PValues , n:: Integer , method:: Holm )
146+ function adjust (pValues:: PValues{T} , n:: Integer , method:: Holm ) where T <: AbstractFloat
147147 k = length (pValues)
148148 check_number_tests (k, n)
149149 if n <= 1
163163struct Hommel <: PValueAdjustment
164164end
165165
166- adjust (pValues:: PValues , method:: Hommel ) = adjust (pValues, length (pValues), method)
166+ adjust (pValues:: PValues{T} , method:: Hommel ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
167167
168- function adjust (pValues:: PValues , n:: Integer , method:: Hommel )
168+ function adjust (pValues:: PValues{T} , n:: Integer , method:: Hommel ) where T <: AbstractFloat
169169 k = length (pValues)
170170 check_number_tests (k, n)
171171 if k <= 1
194194struct Sidak <: PValueAdjustment
195195end
196196
197- adjust (pValues:: PValues , method:: Sidak ) = adjust (pValues, length (pValues), method)
197+ adjust (pValues:: PValues{T} , method:: Sidak ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
198198
199- function adjust (pValues:: PValues , n:: Integer , method:: Sidak )
199+ function adjust (pValues:: PValues{T} , n:: Integer , method:: Sidak ) where T <: AbstractFloat
200200 check_number_tests (length (pValues), n)
201201 pAdjusted = clamp .(1 .- (1 .- pValues). ^ n, 0 , 1 )
202202 return pAdjusted
208208struct ForwardStop <: PValueAdjustment
209209end
210210
211- adjust (pValues:: PValues , method:: ForwardStop ) = adjust (pValues, length (pValues), method)
211+ adjust (pValues:: PValues{T} , method:: ForwardStop ) where T <: AbstractFloat = adjust (pValues, length (pValues), method)
212212
213- function adjust (pValues:: PValues , n:: Integer , method:: ForwardStop )
213+ function adjust (pValues:: PValues{T} , n:: Integer , method:: ForwardStop ) where T <: AbstractFloat
214214 k = length (pValues)
215215 check_number_tests (k, n)
216216 sortedOrder, originalOrder = reorder (pValues)
226226struct BarberCandes <: PValueAdjustment
227227end
228228
229- function adjust (pValues:: PValues , method:: BarberCandes )
229+ function adjust (pValues:: PValues{T} , method:: BarberCandes ) where T <: AbstractFloat
230230 n = length (pValues)
231231 if n <= 1
232232 return fill (1.0 , size (pValues)) # unlike other p-adjust methods
0 commit comments