Description Usage Arguments Details Value Author(s) See Also Examples
This function computes the exponential of a matrix.
1 | expm(x)
|
x |
An numeric matrix |
This functions calls the expm
function from the eponymous package
expm. This is implemented via a registered function call, and does
not required explicit linking at the C level. However, the expm package
is imported in order to access its registered function at the C level.
As the documentation of package expm states, the underlying implementation borrows from the Matrix package which itself takes it from GNU Octave.
A numeric matrix
Dirk Eddelbuettel
The expm package and its documentation.
1 2 3 4 5 6 7 8 9 | ## example is from the vignette in package expm
M <- matrix(c(4, 1, 1, 2, 4, 1, 0, 1, 4), 3, 3)
## expected output
expM <- matrix(c(147.8666, 127.7811, 127.7811, 183.7651, 183.7651,
163.6796, 71.79703, 91.88257, 111.96811), 3, 3)
## we only have the expected result to about six digits
all.equal(expm(M), expM, tolerance=1.0e-6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.