Mode compute returns loglikelihood of 1300, but mode_check states that fval is -inf

I can provide a model file later if necessary (I am now out of the office), but I think this was actually my fault and an extension of the query here: Occbin: "increase maxit or check_ahead_periods" with very high maxit and check_ahead_periods - #13 by Jrs28

Since I set this code running, I replaced my own patched version of update_kalman_algo_1 with your revised version. The difference is the handling of when rank(F) fails; my code simply set rank_F equal to size(F) and continued running, whereas your version throws an error flag. What appears to have happened here is that at the mode found by SA, rank(F) failed. Since I started it running a week ago, it was still using my version where this was acceptable and returned a finite likelihood, whereas mode_compute switches to yours where this throws an error. So I think there’s no need for you to investigate further, sorry for bothering you.