gnu-octave / statistics

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

Make the BIST in glmfit.m reproducible #139

Closed rlaboiss closed 5 months ago

rlaboiss commented 5 months ago

The BIST for glmfit in not reprodubible:

pkg load statistics
while (test ("glmfit", "verbose")) ; endwhile

The code above must run forever, but it eventually stops with a failure message like this:

!!!!! test failed
ASSERT errors for:  assert (b (2),b_true (2),0.5)

  Location  |  Observed  |  Expected  |  Reason
     ()        0.89439        1.5        Abs err 0.60561 exceeds tol 0.5 by 0.1

This is due to the fact that poissrnd returns a different value for each call of the BIST. A call to randp("seed",V) is necessary for making the BiST reproducible.