Commit 6e47230
Fix DomainError from log(0.0) in Julia 1.13 for Poisson/LogLink models
In Julia 1.13, log(0.0) throws DomainError instead of returning -Inf.
During IRLS iterations for Poisson/LogLink models, the linear predictor η
can overflow, causing exp(η) = Inf, then y/μ = 0.0 for finite y, and
ultimately log(0.0) in xlogy inside GLM's devresid.
Mirror GLM.jl's approach: wrap updateμ! and deviance() in try-catch blocks
that catch DomainError and set dev = typemax(T), triggering the existing
step-halving mechanism to recover with a smaller step size.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c900991 commit 6e47230
1 file changed
+14
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
| 707 | + | |
| 708 | + | |
711 | 709 | | |
712 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
713 | 716 | | |
714 | 717 | | |
715 | 718 | | |
| |||
729 | 732 | | |
730 | 733 | | |
731 | 734 | | |
732 | | - | |
733 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
734 | 741 | | |
735 | 742 | | |
736 | 743 | | |
| |||
0 commit comments