getLoglikelihood isNan check