[R] expm()

Laura Hill lhill07 at qub.ac.uk
Tue Mar 6 10:47:05 CET 2007


Can the expm function be used to calculate the exponential of a matrix where
the matrix is multiplied by a vector in a data frame?

For example


for (i in 1:length(y)){

    expmN<-expm(Q*y[i])

    Q<-Matrix(c(1, 2, 3, 4), 2, 2)

    return(expmN)

    }

Sorry I am new to R and I have been finding it difficult to get information
on calculating Matrix exponentials in R.

Many thanks in advance

Laura



More information about the R-help mailing list