As I mentioned in the title, so far I'm using the following code to power a matrix in R. This method is using the expm
package and its %^%
operator.
Qmp <- expm::`%^%`( as.matrix(Qm), (as.numeric(L)-1) )
Last day, I'm trying to execute that for a kind big matrix which dimensions are
> dim(Qm)
[1] 17328 17328
and I realized that is taking too long time to complete. To be honest, I'm running that code for an hour and still didn't finish.
So I was wondering if there is any other way to approach such task and be quicker.
EDIT:
After the powering of the Qm
I'm also performing and a multiplication of two matrices like
Pm <- Qmp %*% as.matrix(Rm)
where
dim(Rm)
>17328 58