BaM-tools / BaM

BaM (Bayesian Modeling) is a framework aimed at estimating a model using a bayesian approach and using it for prediction, with a particular focus on uncertainty quantification.
Other
2 stars 0 forks source link

Prediction results envelop computation fails when there's only NaN #17

Open IvanHeriver opened 1 month ago

IvanHeriver commented 1 month ago

Description

When the prediction spagetti file contains only NaN in a particular row, BaM will fail in the envelop computation and crash with the error At line 89 of file quicksort_X_INC.f90 (it is actually in the miniDMSL lib that the crash occurs). Sorting only NaN is indeed not possible in this case, that is why BaM crashes... However, it would be usefull to simply return NaN for any quantile (or other statistics) computed this way instead of crashing. A simple check before computing any stats could be done so any statistics computation is bypassed in this particular case.

This is an annoying bug for me. It is currently blocking me In my development of BaRatinAGE although I can imagine some workaround on my end.

Reproduction of the bug

You can run the following example to reproduce the error. From within the config files directory, run /path/to/BaM -cf "./Config_BaM.txt.

ISSUE_ENV_STAT_COMPUTATION_FAILS.zip

If you want to prevent failure, simply remove the first 50 values from input_prediction_data.txt and edit the file Config_Pred_u.txt file to indicate that there are 50 observations instead of 100 in the second row.