gnu-octave / statistics

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

Make the BIST in glmfit.m reproducible #139

Closed rlaboiss closed 8 months ago

rlaboiss commented 8 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.