Suppose A is some square matrix. How can I easily exponentiate this matrix in R?
I tried two ways already: Trial 1 with a for-loop hack and Trial 2
A shorter solution with eigenvalue decomposition:
"%^%" <- function(S, power) with(eigen(S), vectors %*% (values^power * t(vectors)))