| matrix.fun | R Documentation |
This function computes the matrix function \bold{F} =f(\bold{A}) where
\bold{A} is upper triangular by applying a Parlett recurrence.
matrix.fun(a, FUN = "log")
a |
an upper triangular matrix. |
FUN |
the function to be applied, by default |
The used-defined function FUN is evaluated at the triangular matrix
argument. This function can be used in conjunction with Schur decomposition
to evaluate the function of a matrix.
Higham, N.J. (1986). Functions of Matrices: Theory and Computation. Society for Industrial and Applied Mathematics, Philadelphia.
a <- matrix(c(1,2,3,0,3,4,0,0,5), ncol = 3, byrow = TRUE)
fnc <- function(x) (1 + x) / x
f <- matrix.fun(a, FUN = fnc)
f
a <- matrix(c(-49,24,-64,31), ncol = 2, byrow = TRUE)
z <- schur(a)
m <- z$m
u <- z$vectors
m <- matrix.fun(m, FUN = exp)
u %*% m %*% t(u) # exp(a)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.