You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MatrixExpPade never scales the matrix, so Pade results are inaccurate for large ‖Qt‖ #137
MatrixExpPade in src/pijt.c computes the 1- and ∞-norms of At before At has been filled in. At that point At is still all zeros from R_Calloc. So l1 = linf = 0, K = -Inf, npower is set to NA_INTEGER and then reset to 0. Scaling and squaring is therefore never done. The order-8 Pade approximant is applied to the unscaled At, and its accuracy degrades as ‖At‖ grows.
This code is reached by MatrixExp(..., method = "pade"), and by msm(..., use.expm = FALSE) when Q has repeated or complex eigenvalues. The default use.expm = TRUE is not affected.
Thanks - I've applied this fix, though I think it is only of academic interest, as msm defers to the expm package for matrix exponentiation in routine use. I'd happily remove the old alternative methods, but I'm curious if there is a case where the expm procedure doesn't work as well?
Activity
Fixes `MatrixExpPade` never scales the matrix, so Pade results are in…
chjackson commentedon Oct 18, 2026
Thanks - I've applied this fix, though I think it is only of academic interest, as msm defers to the expm package for matrix exponentiation in routine use. I'd happily remove the old alternative methods, but I'm curious if there is a case where the expm procedure doesn't work as well?