gnu-octave / statistics

The Statistics package for GNU Octave
GNU General Public License v3.0
24 stars 22 forks source link

Make BIST in fpdf.m reproducible #143

Closed rlaboiss closed 5 months ago

rlaboiss commented 5 months ago

The BIST in inst/dist_fun/fpdf.m fails randomly:

octave:1> pkg load statistics
octave:2> while 1 ; if ! test("fpdf", "verbose") ; break ; endif ; endwhile
[…]
!!!!! test failed
ASSERT errors for:  assert (fpdf (xr, 1, 2),yr,5 * eps)

  Location  |  Observed  |  Expected  |  Reason
     ()         4.4017       4.4017      Abs err 2.6645e-15 exceeds tol 1.1102e-15 by 2e-15
shared variables 
    x =

      -1.0000        0   0.5000   1.0000   2.0000

    y =

            0        0   0.4444   0.2500   0.1111

This proposed commit fixes the problem, by using rand("seed").