Learn R Programming

pbdDMAT (version 0.4-2)

expm: Matrix Exponentiation

Description

Routines for matrix exponentiation.

Usage

expm(x, t = 1, p = 6)

# S4 method for matrix expm(x, t = 1, p = 6)

# S4 method for ddmatrix expm(x, t = 1, p = 6)

Arguments

x

A numeric matrix or a numeric distributed matrix.

t

Scaling parameter for x.

p

Order of the Pade' approximation.

Value

Returns a distributed matrix.

Details

Formally, the exponential of a square matrix X is a power series:

\(expm(X) = id + X/1! + X^2/2! + X^3/3! + \dots\)

where the powers on the matrix correspond to matrix-matrix multiplications.

expm() directly computes the matrix exponential of a distributed, dense matrix. The implementation uses Pade' approximations and a scaling-and-squaring technique (see references).

References

"New Scaling and Squaring Algorithm for the Matrix Exponential" Awad H. Al-Mohy and Nicholas J. Higham, August 2009

Examples

Run this code
# NOT RUN {
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r

library(pbdDMAT, quiet = TRUE)
init.grid()

x <- matrix("rnorm", 5, 5, bldim=2)
expm(x)

# }

Run the code above in your browser using DataLab