Fri Sep 14 08:47:35 2018 WALKER_SAMPLE_TEST: Python version: 3.6.5 Test the WALKER_SAMPLE library. I4_CHOOSE_TEST Python version: 3.6.5 I4_CHOOSE evaluates C(N,K). N K CNK 0 0 1 1 0 1 1 1 1 2 0 1 2 1 2 2 2 1 3 0 1 3 1 3 3 2 3 3 3 1 4 0 1 4 1 4 4 2 6 4 3 4 4 4 1 I4_CHOOSE_TEST: Normal end of execution. I4_UNIFORM_AB_TEST Python version: 3.6.5 I4_UNIFORM_AB computes pseudorandom values in an interval [A,B]. The lower endpoint A = -100 The upper endpoint B = 200 The initial seed is 123456789 1 -35 2 187 3 149 4 69 5 25 6 -81 7 -23 8 -67 9 -87 10 90 11 -82 12 35 13 20 14 127 15 139 16 -100 17 170 18 5 19 -72 20 -96 I4_UNIFORM_AB_TEST: Normal end of execution. NORMALIZE_TEST Python version: 3.6.5 NORMALIZE normalizes entries 1 through N of a vector of length N+2. Initial X: 0: 0.218418 1: 0.956318 2: 0.829509 3: 0.561695 4: 0.415307 5: 0.0661187 6: 0.257578 Initial L1 norm of X(1:5) = 2.82895 Normalized X: 0: 0.218418 1: 0.338047 2: 0.293222 3: 0.198553 4: 0.146806 5: 0.0233722 6: 0.257578 Final L1 norm of X(1:5) = 1 NORMALIZE_TEST Normal end of execution. R8VEC_INDICATOR0_TEST Python version: 3.6.5 R8VEC_INDICATOR0 returns an indicator matrix. The indicator0 vector: 0: 0 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 R8VEC_INDICATOR0_TEST Normal end of execution. R8VEC_PRINT_TEST Python version: 3.6.5 R8VEC_PRINT prints an R8VEC. Here is an R8VEC: 0: 123.456 1: 5e-06 2: -1e+06 3: 3.14159 R8VEC_PRINT_TEST: Normal end of execution. R8VEC_UNIFORM_01_TEST Python version: 3.6.5 R8VEC_UNIFORM_01 computes a random R8VEC. Initial seed is 123456789 Random R8VEC: 0: 0.218418 1: 0.956318 2: 0.829509 3: 0.561695 4: 0.415307 5: 0.0661187 6: 0.257578 7: 0.109957 8: 0.043829 9: 0.633966 R8VEC_UNIFORM_01_TEST: Normal end of execution. RANDOM_PERMUTATION_TEST Python version: 3.6.5 RANDOM_PERMUTATION randomly permutes entries 1 through N of a vector X[0:N+1]. Initial X: 0: 0 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 Permuted X: 0: 0 1: 2 2: 5 3: 1 4: 3 5: 4 6: 6 RANDOM_PERMUTATION_TEST Normal end of execution. WALKER_BUILD_TEST Python version: 3.6.5 WALKER_BUILD builds the Walker sampler data vectors Y and A, given a probability vector X. Binomial PDF (ignore first and last entries): 0: 0 1: 0.0625 2: 0.25 3: 0.375 4: 0.25 5: 0.0625 6: 0 I A[I] Y[i] (ignore first and last entries) 0 0 0 1 3 0.3125 2 2 1 3 4 0.5 4 2 0.75 5 3 0.3125 6 6 2 WALKER_BUILD_TEST Normal end of execution. WALKER_SAMPLER_TEST: Python version: 3.6.5 WALKER_SAMPLER creates Walker sample vectors Y and A for efficient sampling of a discrete probability vector. Test the Walker sampler with a Zipf-type probability. Use seed = 123456789 as input to random.seed ( seed ): Zipf probabilities for N = 10 and parameter P = 2 I X[I] 1 0.645258 2 0.161314 3 0.0716953 4 0.0403286 5 0.0258103 6 0.0179238 7 0.0131685 8 0.0100822 9 0.00796615 10 0.00645258 Randomly permuted X: I X[I] 1 0.0716953 2 0.00645258 3 0.00796615 4 0.0131685 5 0.0403286 6 0.0179238 7 0.0100822 8 0.0258103 9 0.645258 10 0.161314 Built the sampler i Y[i] A[i]: 0 0 0 1 0.716953 10 2 0.0645258 9 3 0.0796615 9 4 0.131685 9 5 0.403286 9 6 0.179238 9 7 0.100822 9 8 0.258103 9 9 0.669902 10 10 1 10 11 2 11 100000 samples: prob #samples: 0.0716953 7175 0.00645258 648 0.00796615 846 0.0131685 1325 0.0403286 4093 0.0179238 1834 0.0100822 1026 0.0258103 2537 0.645258 64672 0.161314 15844 sumvar = 1.15091, (should be about 1) WALKER_SAMPLER_TEST Normal end of execution. WALKER_VERIFY_TEST Python version: 3.6.5 WALKER_VERIFY verifies the Walker sampler data vectors Y and A, for a given probability vector X. Benford PDF (ignore first and last entries): 0: 0 1: 0.30103 2: 0.176091 3: 0.124939 4: 0.09691 5: 0.0791812 6: 0.0669468 7: 0.0579919 8: 0.0511525 9: 0.0457575 10: 0 I A[I] Y[i] (ignore first and last entries) 0 0 0 1 1 1 2 1 0.8966 3 2 0.727 4 2 0.8722 5 2 0.7126 6 3 0.6025 7 1 0.5219 8 1 0.4604 9 1 0.4118 10 10 2 The verification sum = 1.38778e-16 It should be very close to zero. WALKER_VERIFY_TEST Normal end of execution. ZIPF_PROBABILITY_TEST Python version: 3.6.5 ZIPF_PROBABILITY sets up a probablity vector X of N+2 elements containing in X[1:N] the probabilities of outcomes 1 through N in a Zipf distribution with parameter P. X for N = 5, P = 1.0 0: 0 1: 0.437956 2: 0.218978 3: 0.145985 4: 0.109489 5: 0.0875912 6: 0 X for N = 5, P = 2.0 0: 0 1: 0.683242 2: 0.17081 3: 0.0759157 4: 0.0427026 5: 0.0273297 6: 0 X for N = 10, P = 2.0 0: 0 1: 0.645258 2: 0.161314 3: 0.0716953 4: 0.0403286 5: 0.0258103 6: 0.0179238 7: 0.0131685 8: 0.0100822 9: 0.00796615 10: 0.00645258 11: 0 ZIPF_PROBABILITY_TEST Normal end of execution. WALKER_SAMPLE_TEST: Normal end of execution. Fri Sep 14 08:47:36 2018