text
stringlengths
0
601k
let hist_bins_sorted_low ( ) = Alcotest . ( check ( array int ) ) " bin below sorted " [ | 0 ] | ( To_test . hist_bin_sorted Data . bin_low Data . x1_sorted )
let hist_bins_sorted_high ( ) = Alcotest . ( check ( array int ) ) " bin above sorted " [ | 0 ] | ( To_test . hist_bin Data . bin_high Data . x1_sorted )
let hist_bins_wrong ( ) = Alcotest . ( check_raises ) " histogram with bins " ( Failure " Need at least two bin boundaries " ) ! ( fun ( ) -> To_test . hist_bin Data . bin_wrong Data . x1 |> ignore )
let hist_bins_2 ( ) = Alcotest . ( check ( array int ) ) " histogram with infinite bins " [ | 1 ; 2 ; 2 ] | ( To_test . hist_bin Data . bin2 Data . x2 )
let hist_bins_sorted_2 ( ) = Alcotest . ( check ( array int ) ) " histogram with infinite bins sorted " [ | 1 ; 2 ; 2 ] | ( To_test . hist_bin_sorted Data . bin2 Data . x2_sorted )
let fao = let open Alcotest in let fl = testable Fmt . float ( fun x y -> x = y || abs_float ( x . - y ) <= eps ) in option ( array fl )
let hist_bins_weights ( ) = Alcotest . ( check ( pair ( array int ) fao ) ) " weighted histogram with bins " ( [ | 3 ] , | Some [ | 3 . ] ) | ( To_test . hist_bin_weighted Data . bin1 Data . w1 Data . x1 )
let hist_bins_weights_sorted ( ) = Alcotest . ( check ( pair ( array int ) fao ) ) " weighted histogram with bins sorted " ( [ | 3 ] , | Some [ | 3 . ] ) | ( To_test . hist_bin_weighted_sorted Data . bin1 Data . w1_sorted Data . x1_sorted )
let hist_bins_normalise ( ) = Alcotest . ( check ( pair fao fao ) ) " normalisation test unweighted " ( Some [ | 1 . . / 5 . ; 2 . . / 5 . ; 2 . . / 5 . ] | , Some [ | 1 . . / 5 . ; 2 . . / 5 . . / sqrt 0 . 5 ; 2 . . / 5 . . / ( 3 . . - sqrt 0 . 5 ) ] | ) ( To_test . hist_normalise Data . bin2 Data . x2 )
let hist_bins_normalise_weights ( ) = Alcotest . ( check ( pair fao fao ) ) " normalisation test with weights " ( Some [ | 2 . . / 4 . 2 ; 1 . . / 4 . 2 ; 1 . 2 . / 4 . 2 ] | , Some [ | 2 . . / 4 . 2 ; 1 . . / 4 . 2 . / sqrt 0 . 5 ; 1 . 2 . / 4 . 2 . / ( 3 . . - sqrt 0 . 5 ) ] | ) ( To_test . hist_normalise Data . bin2...
let hist_bins_normalise_binf ( ) = Alcotest . ( check ( pair fao fao ) ) " normalisation test unweighted , infinite bins " ( Some [ | 1 . . / 6 . ; 2 . . / 6 . ; 3 . . / 6 . ] , | Some [ | 0 . ; 2 . . / 6 . . / sqrt 0 . 5 ; 0 . ] ) | ( To_test . hist_normalise Data . bin2_inf Data . x2 )
let tukey_fences ( ) = Alcotest . ( check ( pair ( float 0 . 0 ) ( float 0 . 0 ) ) ) " tukey fences test with data containing outliers " ( - 3 . 0 , 5 . 0 ) ( To_test . tukey_fences Data . with_outliers )
let quantiles ( ) = Alcotest . ( check fao ) " quantiles calculation " ( Some [ | 0 . 106500 ; 0 . 190700 ; 0 . 376750 ; 0 . 767625 ; 0 . 978800 ] ) | ( To_test . quantiles ~ p [ :| 0 . ; 0 . 25 ; 0 . 5 ; 0 . 75 ; 1 . ] | [ | 0 . 1182 ; 0 . 8388 ; 0 . 4569 ; 0 . 1902 ; 0 . 8652 ; 0 . 2966 ; 0 . 9788 ; 0 . 5541 ; 0 . 10...
let test_set = [ " mannwhitneyu_test_left_side_asym " , ` Slow , mannwhitneyu_test_left_side_asym ; " mannwhitneyu_test_right_side_asym " , ` Slow , mannwhitneyu_test_right_side_asym ; " mannwhitneyu_test_both_side_asym " , ` Slow , mannwhitneyu_test_both_side_asym ; " mannwhitneyu_test_both_side_exact " , ` Slow , man...
type ( ' a , ' b ) t_iter = ( ' a -> int -> ' b -> ' a ) -> ' a -> int * ' a
let trace pos = let a , b , c , d = pos in Printf . printf " trace :% s :% d :% d :% d \ n " %! a b c d
module Cubic = struct type t = { lx : float ; rx : float ; dx : float ; p0 : float ; p1 : float ; p ' 0 : float ; p ' 1 : float ; poly : float array } let f t x = let u = ( x . - t . lx ) . / t . dx in let u2 = u . * u in let u3 = u2 . * u in ( t . poly . ( 0 ) . * u3 ) . + ( t . poly . ( 1 ) . * u2 ) . + ( t . poly . ...
module CdfTree = struct type binary_node = | Leaf of int | Balance of ( float * binary_node * binary_node ) let rec create_node cdf_x_of_p logn p dp i di = if logn <= 0 then Leaf ( i / 2 ) else ( let ndp = dp . / 2 . in let ndi = di / 2 in let node_l = create_node cdf_x_of_p ( logn - 1 ) ( p . - ndp ) ndp ( i - ndi ) n...
let _ = let tree = CdfTree . create_from_rv ( M . gaussian_cdf ~ mu : 0 . ~ sigma : 1 . ) 5 in CdfTree . display tree ; List . iter ( fun x -> Printf . printf " bucket of % f : % d \ n " x ( CdfTree . value tree x ) ) [ - 1 . ; - 0 . 5 ; 0 . ; 0 . 5 ; 1 . ]
module Distribution = struct type t = { name : string ; num_buckets : int ; cdf_x_array : float array ; pdf_x_array : float array ; cubics : t_cubic array ; dut_cdf : float -> float ; dut_pdf : float -> float } let create name dut_cdf dut_pdf cdf_x_array pdf_x_array = let num_buckets = Array . length cdf_x_array - 1 in...
module RandomTest = struct type test_hypothesis = { test_name : string ; score_name : string ; hypothesis : M . hypothesis } let make_hypothesis reject p_value score : M . hypothesis = { reject ; p_value ; score } let make_test_hypothesis test_name score_name hypothesis = { test_name ; score_name ; hypothesis } let is_...
module BinaryTest = struct include RandomTest let frequency ( ? significance = 0 . 01 ) ( ? p = 0 . 5 ) iter = let q = 1 . . - p in let inc_if_true_else_dec acc _ b = if b then acc + 1 else acc - 1 in let n , sum = iter inc_if_true_else_dec 0 in let x = float sum . - ( ( ( 2 . . * p ) . - 1 . ) . * float n ) in let x =...
let test_rough_cdf pydist = let ( name , imprecision , dut_cdf , dut_pdf , dut_logcdf , dut_logpdf , dut_opt_ppf , dut_sf , dut_logsf , dut_opt_isf , cdf_x_array , pdf_x_array ) = pydist in let dist = Distribution . create name dut_cdf dut_pdf cdf_x_array pdf_x_array in let sum_diff_cdf_2 = ref 0 . in let sum_diff_pdf_...
let test_rough_cdf_matches _ = List . iter test_rough_cdf cdf_approximations ; ( )
let _ = Owl_stats_prng . self_init ( ) ; Owl_stats_prng . sfmt_seed 1
let one_third = 1 . . / 3 .
type t_bin_iter = | IOfBool of ( ( int , bool ) t_iter -> RandomTest . test_hypothesis ) | IIIIOfBool of ( ( int * int * int * int , bool ) t_iter -> RandomTest . test_hypothesis ) | IIFIOfBool of ( ( int * int * float * int , bool ) t_iter -> RandomTest . test_hypothesis )
let bin_frequency = IOfBool BinaryTest . frequency
let bin_frequency_1_of_3 = IOfBool ( BinaryTest . frequency ~ p : one_third )
let bin_block_frequency_7 = IIFIOfBool ( BinaryTest . block_frequency 7 )
let bin_block_frequency_70 = IIFIOfBool ( BinaryTest . block_frequency 70 )
let bin_block_frequency_700 = IIFIOfBool ( BinaryTest . block_frequency 700 )
let bin_block_frequency_1_of_3_7 = IIFIOfBool ( BinaryTest . block_frequency ~ p : one_third 7 )
let bin_block_frequency_1_of_3_70 = IIFIOfBool ( BinaryTest . block_frequency ~ p : one_third 70 )
let bin_block_frequency_1_of_3_700 = IIFIOfBool ( BinaryTest . block_frequency ~ p : one_third 700 )
let bin_patterns_2 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 2 )
let bin_patterns_3 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 3 )
let bin_patterns_4 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 4 )
let bin_patterns_5 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 5 )
let bin_patterns_6 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 6 )
let bin_patterns_7 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 7 )
let bin_patterns_8 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 8 )
let bin_patterns_9 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 9 )
let bin_patterns_10 = IIIIOfBool ( BinaryTest . occurrences_of_patterns 8 10 )
let bin_fft_64 = IOfBool ( BinaryTest . fft ~ n : 64 )
let bin_fft_1024 = IOfBool ( BinaryTest . fft ~ n : 1024 )
let run_random_tests test_name pretest sampler tests = let run_test ( test , should_reject , start , length ) = pretest ( ) ; let test_result = match test with | IOfBool t -> t ( RandomTest . iterate sampler start length ) | IIFIOfBool t -> t ( RandomTest . iterate sampler start length ) | IIIIOfBool t -> t ( RandomTes...
let tests_for_p_0_5 = [ bin_frequency , false , 0 , 2000 ; bin_frequency , false , 0 , 10000 ; bin_frequency_1_of_3 , true , 0 , 1000 ; bin_frequency_1_of_3 , true , 0 , 10000 ; bin_block_frequency_7 , false , 0 , 100 ; bin_block_frequency_7 , false , 0 , 1000 ; bin_block_frequency_70 , false , 0 , 1000 ; bin_block_fre...
let tests_for_p_0_3 = [ bin_frequency , true , 0 , 1000 ; bin_frequency , true , 0 , 10000 ; bin_frequency_1_of_3 , false , 0 , 100 ; bin_frequency_1_of_3 , false , 0 , 1000 ; bin_frequency_1_of_3 , false , 0 , 10000 ; bin_block_frequency_7 , false , 0 , 100 ; bin_block_frequency_7 , false , 0 , 1000 ; bin_block_freque...
let test_true_is_not_random _ = Owl_stats_prng . sfmt_seed 1 ; let test_name = " always true " in let pretest _ = ( ) in let sampler _ length = length , fun _ -> true in let tests = [ bin_frequency , true , 0 , 100 ; bin_block_frequency_7 , true , 0 , 100 ; bin_fft_64 , false , 0 , 1024 ; bin_fft_1024 , true , 0 , 1024...
let test_alternate_is_not_random _ = Owl_stats_prng . sfmt_seed 1 ; let test_name = " every other " in let pretest _ = ( ) in let sampler _ length = length , fun x -> x land 1 == 0 in let tests = [ bin_frequency , false , 0 , 100 ; bin_block_frequency_7 , false , 0 , 100 ; bin_patterns_2 , true , 0 , 1000 ; bin_pattern...
let test_three_of_four_is_not_random _ = Owl_stats_prng . sfmt_seed 1 ; let test_name = " three of four " in let pretest _ = ( ) in let sampler _ length = length , fun x -> x land 3 == 0 in let tests = [ bin_frequency , true , 0 , 100 ; bin_block_frequency_7 , false , 0 , 100 ; bin_block_frequency_7 , false , 0 , 1000 ...
let test_two_of_four_is_not_random _ = Owl_stats_prng . sfmt_seed 1 ; let test_name = " two of four " in let pretest _ = ( ) in let sampler _ length = length , fun x -> x land 3 < 2 in let tests = [ bin_frequency , false , 0 , 100 ; bin_block_frequency_7 , false , 0 , 100 ; bin_block_frequency_7 , false , 0 , 1000 ; bi...
let test_uniform_ints_0_1 _ = let test_name = " uniform_int ~ a : 0 ~ b : 1 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . uniform_int_rvs ~ a : 0 ~ b : 1 == 0 in let tests = [ bin_frequency , false , 0 , 100 ; bin_frequency , false , 0 , 1000 ; bin_frequency , false ,...
let test_uniform_ints_1_100 _ = let test_name = " uniform_int ~ a : 1 ~ b : 100 <= 50 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . uniform_int_rvs ~ a : 1 ~ b : 100 < 51 in let tests = [ bin_frequency , false , 0 , 100 ; bin_frequency , false , 0 , 1000 ; bin_frequen...
let test_uniform_ints_1_100_even _ = let test_name = " uniform_int ~ a : 1 ~ b : 100 even " in let pretest _ = Owl_stats_prng . sfmt_seed 0 in let sampler _ length = length , fun _ -> M . uniform_int_rvs ~ a : 1 ~ b : 100 land 1 == 0 in let tests = tests_for_p_0_5 in run_random_tests test_name pretest sampler tests
let test_uniform_ints_0_to_65535 ( bit : int ) _ = let test_name = sfmt " uniform_int ~ a : 0 ~ b : 65535 bit % d " bit in let pretest _ = Owl_stats_prng . sfmt_seed 0 in let sampler _ length = length , fun _ -> ( M . uniform_int_rvs ~ a : 0 ~ b : 65535 lsr bit ) land 1 == 0 in let tests = tests_for_p_0_5 in run_random...
let test_uniform_ints_0_to_65535_bit_0 _ = test_uniform_ints_0_to_65535 0 ( )
let test_uniform_ints_0_to_65535_bit_1 _ = test_uniform_ints_0_to_65535 1 ( )
let test_uniform_ints_0_to_65535_bit_2 _ = test_uniform_ints_0_to_65535 2 ( )
let test_uniform_ints_0_to_65535_bit_3 _ = test_uniform_ints_0_to_65535 3 ( )
let test_uniform_ints_0_to_65535_bit_4 _ = test_uniform_ints_0_to_65535 4 ( )
let test_uniform_ints_0_to_65535_bit_5 _ = test_uniform_ints_0_to_65535 5 ( )
let test_uniform_ints_0_to_65535_bit_6 _ = test_uniform_ints_0_to_65535 6 ( )
let test_uniform_ints_0_to_65535_bit_7 _ = test_uniform_ints_0_to_65535 7 ( )
let test_uniform_ints_0_to_65535_bit_8 _ = test_uniform_ints_0_to_65535 8 ( )
let test_uniform_ints_0_to_65535_bit_9 _ = test_uniform_ints_0_to_65535 9 ( )
let test_uniform_ints_0_to_65535_bit_10 _ = test_uniform_ints_0_to_65535 10 ( )
let test_uniform_ints_0_to_65535_bit_11 _ = test_uniform_ints_0_to_65535 11 ( )
let test_uniform_ints_0_to_65535_bit_12 _ = test_uniform_ints_0_to_65535 12 ( )
let test_uniform_ints_0_to_65535_bit_13 _ = test_uniform_ints_0_to_65535 13 ( )
let test_uniform_ints_0_to_65535_bit_14 _ = test_uniform_ints_0_to_65535 14 ( )
let test_uniform_ints_0_to_65535_bit_15 _ = test_uniform_ints_0_to_65535 15 ( )
let test_uniform_ints_1_100_48 _ = let test_name = " uniform_int ~ a : 1 ~ b : 100 <= 48 " in let pretest _ = Owl_stats_prng . sfmt_seed 0 in let sampler _ length = length , fun _ -> M . uniform_int_rvs ~ a : 1 ~ b : 100 <= 48 in let tests = [ bin_frequency , false , 0 , 100 ; bin_frequency , false , 0 , 1000 ; bin_fre...
let test_uniform_ints_1_100_45 _ = let test_name = " uniform_int ~ a : 1 ~ b : 100 <= 45 " in let pretest _ = Owl_stats_prng . sfmt_seed 0 in let sampler _ length = length , fun _ -> M . uniform_int_rvs ~ a : 1 ~ b : 100 <= 45 in let tests = [ bin_frequency , false , 0 , 100 ; bin_frequency , true , 0 , 1000 ; bin_freq...
let test_uniform_ints_1_300_100 _ = let test_name = " uniform_int ~ a : 1 ~ b : 300 mod 3 is 0 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . uniform_int_rvs ~ a : 1 ~ b : 300 mod 3 = 0 in let tests = [ bin_frequency , true , 0 , 100 ; bin_frequency , true , 0 , 1000 ;...
let test_gaussian_mean_0 _ = let test_name = " gaussian mean 0 sd 1 > 0 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . gaussian_rvs ~ mu : 0 . ~ sigma : 1 . > 0 . in let tests = tests_for_p_0_5 in run_random_tests test_name pretest sampler tests
let test_gaussian_mean_0_p0_3_left _ = let test_name = " gaussian mean 0 sd 1 < . - 43 0 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . gaussian_rvs ~ mu : 0 . ~ sigma : 1 . < - 0 . 43 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_gaussian_mean_0_p0_3_right _ = let test_name = " gaussian mean 0 sd 1 > 0 . 43 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . gaussian_rvs ~ mu : 0 . ~ sigma : 1 . > 0 . 43 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_exponential_lambda_1 _ = let test_name = " exponential lambda 1 > 0 . 69 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . exponential_rvs ~ lambda : 1 . > 0 . 69 in let tests = tests_for_p_0_5 in run_random_tests test_name pretest sampler tests
let test_exponential_lambda_1_p0_3_left _ = let test_name = " exponential lambda 1 < 0 . 41 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . exponential_rvs ~ lambda : 1 . < 0 . 41 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_exponential_lambda_1_p0_3_right _ = let test_name = " exponential lambda 1 > 1 . 10 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . exponential_rvs ~ lambda : 1 . > 1 . 10 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_hypergeometric_50_500_100 _ = let test_name = " hypergeometric 50 of 500 good pick 100 > 9 good " in let pretest _ = Owl_stats_prng . sfmt_seed 2 in let sampler _ length = length , fun _ -> M . hypergeometric_rvs ~ good : 100 ~ bad ( : 1000 - 100 ) ~ sample : 195 >= 20 in let tests = tests_for_p_0_5 in run_ran...
let test_hypergeometric_50_500_100_p0_3_left _ = let test_name = " hypergeometric 50 of 500 good pick 100 > 9 good " in let pretest _ = Owl_stats_prng . sfmt_seed 2 in let sampler _ length = length , fun _ -> M . hypergeometric_rvs ~ good : 100 ~ bad ( : 1000 - 100 ) ~ sample : 180 >= 20 in let tests = tests_for_p_0_3 ...
let test_hypergeometric_50_500_100_p0_3_right _ = let test_name = " hypergeometric 50 of 500 good pick 100 > 9 good " in let pretest _ = Owl_stats_prng . sfmt_seed 2 in let sampler _ length = length , fun _ -> M . hypergeometric_rvs ~ good : 100 ~ bad ( : 1000 - 100 ) ~ sample : 212 < 20 in let tests = tests_for_p_0_3 ...
let test_gamma_shape_7_5_scale_1 _ = let test_name = " gamma scale 7 . 5 scale 1 . 0 > 7 . 17 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . gamma_rvs ~ shape : 7 . 5 ~ scale : 1 . > 7 . 17 in let tests = tests_for_p_0_5 in run_random_tests test_name pretest sampler te...
let test_gamma_shape_7_5_scale_1_p0_3_left _ = let test_name = " gamma scale 7 . 5 scale 1 . 0 < 6 . 08 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . gamma_rvs ~ shape : 7 . 5 ~ scale : 1 . < 6 . 08 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest ...
let test_gamma_shape_7_5_scale_1_p0_3_right _ = let test_name = " gamma scale 7 . 5 scale 1 . 0 > 8 . 38 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . gamma_rvs ~ shape : 7 . 5 ~ scale : 1 . > 8 . 38 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest...
let test_beta_alpha_2_beta_5 _ = let test_name = " beta ( alpha 2 beta 5 ) 0 . 265 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . beta_rvs ~ a : 2 . 0 ~ b : 5 . 0 > 0 . 265 in let tests = tests_for_p_0_5 in run_random_tests test_name pretest sampler tests
let test_beta_alpha_2_beta_5_p0_3_left _ = let test_name = " beta ( alpha 2 beta 5 ) < 0 . 195 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . beta_rvs ~ a : 2 . 0 ~ b : 5 . 0 < 0 . 195 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_beta_alpha_2_beta_5_p0_3_right _ = let test_name = " beta ( alpha 2 beta 5 ) > 0 . 341 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . beta_rvs ~ a : 2 . 0 ~ b : 5 . 0 > 0 . 341 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_chi2_df_4 _ = let test_name = " chi2 ( 4 df ) > 3 . 36 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . chi2_rvs ~ df : 4 . 00 > 3 . 36 in let tests = tests_for_p_0_5 in run_random_tests test_name pretest sampler tests
let test_chi2_df_4_p0_3_left _ = let test_name = " chi2 ( 4 df ) < 2 . 38 " in let pretest _ = Owl_stats_prng . sfmt_seed 2 in let sampler _ length = length , fun _ -> M . chi2_rvs ~ df : 4 . 00 < 2 . 38 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_chi2_df_4_p0_3_right _ = let test_name = " chi2 ( 4 df ) > 4 . 58 " in let pretest _ = Owl_stats_prng . sfmt_seed 1 in let sampler _ length = length , fun _ -> M . chi2_rvs ~ df : 4 . 00 > 4 . 58 in let tests = tests_for_p_0_3 in run_random_tests test_name pretest sampler tests
let test_set = [ " true_is_not_random " , ` Slow , test_true_is_not_random ; " alternate_is_not_random " , ` Slow , test_alternate_is_not_random ; " three_of_four_is_not_random " , ` Slow , test_three_of_four_is_not_random ; " two_of_four_is_not_random " , ` Slow , test_two_of_four_is_not_random ; " uniform_int_0_or_1 ...
let cdf_approximations = M . [ ( " students_1 . 000000_loc_0 . 000000_scale_1 . 000000 " , 1 . 000000 , t_cdf ~ df : 1 . 000000 ~ loc : 0 . 000000 ~ scale : 1 . 000000 , t_pdf ~ df : 1 . 000000 ~ loc : 0 . 000000 ~ scale : 1 . 000000 , t_logcdf ~ df : 1 . 000000 ~ loc : 0 . 000000 ~ scale : 1 . 000000 , t_logpdf ~ df :...
let parse_string ( ? eof = true ) p s = if eof then parse_string ( ( ) << p MParser . eof ) s ( ) else parse_string p s ( )
let assert_parse_eq ( ? eof = true ) p str v = match parse_string ~ eof p str with | Failed _ -> assert_failure " parse failure " | Success x -> assert_equal x v
let assert_parse ( ? eof = true ) p str = match parse_string ~ eof p str with | Failed _ -> assert_failure " parse failure " | Success _ -> assert_bool " ok " true
let assert_parse_fail ( ? eof = true ) p str = match parse_string ~ eof p str with | Failed _ -> assert_bool " ok " true | Success _ -> assert_failure " expected parse failure "