Open adamsardar opened 4 years ago
This will require some careful study. From studying '19 dubious ways to compute a matrix exponential' it would seem that the Schur-Parlett method of iterative compution of the elements of exp(T) is suitable.
See A SCHUR–PARLETT ALGORITHM FOR COMPUTING MATRIX FUNCTIONS (Davies) for more info - they talk of a form suitable for blocked matrices.
BioPlanet runs in on our erlotinib example in:
Linux Matrix:expm ~90s expoRkit::expv ~30s
Windows Matrix:expm ~1200s (20 minutes!!) expoRkit::expv - not run (need Rtools to install)
If expoRkit is competative on Windows, consider copying in the fortran code from expoRkit (since it is not on CRAN to depend on - we also don't need to pade approximations).
Thinking about it, this is almost certainly the terrible BLAS libraries that come with R on windows.
if the aim is to make something performant for windows users, then a partial re-implementation using RcppEigen might be the route forward.
The Pade approximation and exploitation of the block structure seems the way ...
The phase-type matrix has a large number of symmetries (it is Toeplitz block tridiagonal). This should produce a much easier means of computing the matrix exponential.
Benchmark and optimise. How much of an overhead is S4 adding here? I presume not much.