File: expm-methods.Rd

package info (click to toggle)
rmatrix 1.7-4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,096 kB
  • sloc: ansic: 97,203; makefile: 280; sh: 165
file content (84 lines) | stat: -rw-r--r-- 2,613 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
\name{expm-methods}
\title{Matrix Exponential}
%
\docType{methods}
\keyword{array}
\keyword{math}
\keyword{methods}
%
\alias{expm}
\alias{expm-methods}
%
\alias{expm,Matrix-method}
\alias{expm,dMatrix-method}
\alias{expm,ddiMatrix-method}
\alias{expm,dgeMatrix-method}
\alias{expm,dspMatrix-method}
\alias{expm,dsparseMatrix-method}
\alias{expm,dsyMatrix-method}
\alias{expm,dtpMatrix-method}
\alias{expm,dtrMatrix-method}
\alias{expm,matrix-method}
%
\description{
  Compute the exponential of a matrix.
}
\usage{
expm(x)
}
\arguments{
  \item{x}{a matrix, typically inheriting from the
    \code{\linkS4class{dMatrix}} class.}
}
\details{
  The exponential of a matrix is defined as the infinite Taylor
  series \code{expm(A) = I + A + A^2/2! + A^3/3! + ...} (although this is
  definitely not the way to compute it).  The method for the
  \code{dgeMatrix} class uses Ward's diagonal Pade' approximation with
  three step preconditioning, a recommendation from
  Moler & Van Loan (1978) \dQuote{Nineteen dubious ways\dots}.
}
\value{
  The matrix exponential of \code{x}.
}
\references{
  \url{https://en.wikipedia.org/wiki/Matrix_exponential}

  Cleve Moler and Charles Van Loan (2003)
  Nineteen dubious ways to compute the exponential of a matrix,
  twenty-five years later. \emph{SIAM Review} \bold{45}, 1, 3--49.
  \doi{10.1137/S00361445024180}

  \emph{for historical reference mostly:}\cr
  Moler, C. and Van Loan, C. (1978)
  Nineteen dubious ways to compute the exponential of a matrix.
  \emph{SIAM Review} \bold{20}, 4, 801--836.
  \doi{10.1137/1020098}

  %% MM: Till we have something better, this is quite good:
  Eric W. Weisstein et al. (1999) \emph{Matrix Exponential}.
  From MathWorld, \url{https://mathworld.wolfram.com/MatrixExponential.html}
}
\author{This is a translation of the implementation of the corresponding
  Octave function contributed to the Octave project by
  A. Scottedward Hodel \email{A.S.Hodel@Eng.Auburn.EDU}.  A bug in there
  has been fixed by Martin Maechler.
}
%\note{}
\seealso{
  Package \CRANpkg{expm}, which provides newer (in some cases
  faster, more accurate) algorithms for computing the matrix
  exponential via its own (non-generic) function \code{expm()}.
  \pkg{expm} also implements \code{logm()}, \code{sqrtm()}, etc.

  Generic function \code{\link{Schur}}.
}
\examples{
(m1 <- Matrix(c(1,0,1,1), ncol = 2))
(e1 <- expm(m1)) ; e <- exp(1)
stopifnot(all.equal(e1@x, c(e,0,e,e), tolerance = 1e-15))
(m2 <- Matrix(c(-49, -64, 24, 31), ncol = 2))
(e2 <- expm(m2))
(m3 <- Matrix(cbind(0,rbind(6*diag(3),0))))# sparse!
(e3 <- expm(m3)) # upper triangular
}