expm: Compute the exponential of a matrix

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/RcppExports.R

Description

This function computes the exponential of a matrix.

Usage

1
expm(x)

Arguments

x

An numeric matrix

Details

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.

Value

A numeric matrix

Author(s)

Dirk Eddelbuettel

See Also

The expm package and its documentation.

Examples

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)

eddelbuettel/rcppkalman documentation built on June 19, 2020, 4:28 a.m.