@@ -19,7 +19,8 @@ using Base.Test
1919 BenjaminiYekutieli => [0.0 , 0.001464484 , 0.009763228 , 0.073224206 , 0.292896825 , 0.488161376 , 0.836848073 , 1.0 , 1.0 , 1.0 ],
2020 BenjaminiLiu => [0.0 , 0.0008096761 , 0.0063776447 , 0.0475542565 , 0.1589448656 , 0.2047550000 , 0.2361600000 , 0.2361600000 , 0.2361600000 , 0.2361600000 ],
2121 Sidak => [0.0 , 0.0009995501 , 0.0099551198 , 0.0956179250 , 0.4012630608 , 0.6513215599 , 0.8926258176 , 0.9939533824 , 0.9999990463 , 1.0000000000 ],
22- ForwardStop => [0.0 , 0.0000500025 , 0.0003668351 , 0.0027877103 , 0.0124888271 , 0.0279674419 , 0.0558497432 , 0.1127217283 , 0.2542297986 , 1.0 ]
22+ ForwardStop => [0.0 , 0.0000500025 , 0.0003668351 , 0.0027877103 , 0.0124888271 , 0.0279674419 , 0.0558497432 , 0.1127217283 , 0.2542297986 , 1.0 ],
23+ BarberCandes => [0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.375 , 1.0 , 1.0 ]
2324 )
2425
2526 # p-values with ties
@@ -33,7 +34,8 @@ using Base.Test
3334 BenjaminiYekutieli => [0.001464484 , 0.001464484 , 0.009763228 , 0.073224206 , 0.292896825 , 0.418424036 , 0.418424036 , 1.0 , 1.0 , 1.0 ],
3435 BenjaminiLiu => [0.0009995501 , 0.0009995501 , 0.0063776447 , 0.0475542565 , 0.1589448656 , 0.2047550000 , 0.2047550000 , 0.2352000000 , 0.2352000000 , 0.2352000000 ],
3536 Sidak => [0.0009995501 , 0.0009995501 , 0.0099551198 , 0.0956179250 , 0.4012630608 , 0.6513215599 , 0.6513215599 , 0.9939533824 , 0.9999990463 , 1.0000000000 ],
36- ForwardStop => [0.0001000050 , 0.0001000050 , 0.0004001701 , 0.0028127115 , 0.0125088281 , 0.0279841094 , 0.0390378817 , 0.0980113495 , 0.2411539063 , 1.0 ]
37+ ForwardStop => [0.0001000050 , 0.0001000050 , 0.0004001701 , 0.0028127115 , 0.0125088281 , 0.0279841094 , 0.0390378817 , 0.0980113495 , 0.2411539063 , 1.0 ],
38+ BarberCandes => [0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.2857142857 , 0.375 , 1.0 , 1.0 ]
3739 )
3840
3941 # smallest p-values from larger set
@@ -56,11 +58,16 @@ using Base.Test
5658 @test_throws DomainError adjust ([0.5 , 1.5 ], method ())
5759
5860 # # any single p-value is returned unchanged
59- if method != ForwardStop # this test is not valid for ForwardStop
61+ if ! ( method in [ ForwardStop, BarberCandes]) # this test is not valid for ForwardStop
6062 pval = rand (1 )
6163 @test adjust (pval, method ()) == pval
6264 end
6365
66+ if (method == BarberCandes)
67+ pval = rand (1 )
68+ @test adjust (pval, method ()) == ones (pval)
69+ end
70+
6471 # # compare with reference values
6572 @test isapprox ( adjust (pval1, method ()), ref1[method], atol = 1e-9 )
6673 @test isapprox ( adjust (PValues (pval1), method ()), ref1[method], atol = 1e-9 )
@@ -91,7 +98,16 @@ using Base.Test
9198
9299 end
93100
101+ @testset " BarberCandès #2:" begin # some additional tests
102+ for k= 1 : 5
103+ srand (k)
104+ pv = rand (BetaUniformMixtureModel (0.5 , 0.5 , 7.0 ), 40 )
105+ @test isapprox (adjust (pv, BarberCandes ()),
106+ MultipleTesting. barber_candes_brute_force (pv), atol= 1e-9 )
107+ end
108+ end
94109end
95110
96- end
97111
112+
113+ end
0 commit comments