L-BFGS-B divergence however error code is not correct
Closed this issue · 2 comments
clarkliming commented
when fitting mmrm we can run into such issue
Warning message:
In mmrm(FEV1 ~ AVISIT + us(AVISIT | USUBJID), data = fev) :
Divergence with optimizer L-BFGS-B due to problems: L-BFGS-B needs finite values of 'fn'
and immediately
Error in UseMethod("logLik") :
no applicable method for 'logLik' applied to an object of class "c('mmrm_fit', 'list')"
The reason is that L-BFGS-B
final status is warning instead of error.
reprex.
fev = data.table::data.table(fev_data)
fev[seq(1, 800, 4), FEV1 := 0]
mmrm(FEV1 ~ AVISIT + us(AVISIT|USUBJID), data = fev)
clarkliming commented
related to #311 but I wonder why for these divergent values we still want to keep them as "success"? Is there any cases that this error is reported however a result is also returned? @danielinteractive
danielinteractive commented
Thanks @clarkliming , maybe there was a change in the optim here, but yeah in principle this should be an error I guess. Maybe just need to adapt the filter for warnings in the helper functions?