expmCond: Exponential Condition Number of a Matrix

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

View source: R/expmCond-all.R

Description

Compute the exponential condition number of a matrix, either with approximation methods, or exactly and very slowly.

Usage

1
2
3
expmCond(A, method = c("1.est", "F.est", "exact"),
         expm = TRUE, abstol = 0.1, reltol = 1e-6,
         give.exact = c("both", "1.norm", "F.norm"))

Arguments

A

a square matrix

method

a string; either compute 1-norm or F-norm approximations, or compte these exactly.

expm

logical indicating if the matrix exponential itself, which is computed anyway, should be returned as well.

abstol, reltol

for method = "F.est", numerical >= 0, as absolute and relative error tolerance.

give.exact

for method = "exact", specify if only the 1-norm, the Frobenius norm, or both are to be computed.

Details

method = "exact", aka Kronecker-Sylvester algorithm, computes a Kronecker matrix of dimension n^2 x n^2 and hence, with O(n^5) complexity, is prohibitely slow for non-small n. It computes the exact exponential-condition numbers for both the Frobenius and/or the 1-norm, depending on give.exact.

The two other methods compute approximations, to these norms, i.e., estimate them, using algorithms from Higham, chapt.~3.4, both with complexity O(n^3).

Value

when expm = TRUE, for method = "exact", a list with components

expm

containing the matrix exponential, expm.Higham08(A).

expmCond(F|1)

numeric scalar, (an approximation to) the (matrix exponential) condition number, for either the 1-norm (expmCond1) or the Frobenius-norm (expmCondF).

When expm is false and method one of the approximations ("*.est"), the condition number is returned directly (i.e., numeric of length one).

Author(s)

Michael Stadelmann (final polish by Martin Maechler).

References

Awad H. Al-Mohy and Nicholas J. Higham (2009). Computing Fréchet Derivative of the Matrix Exponential, with an application to Condition Number Estimation; MIMS EPrint 2008.26; Manchester Institute for Mathematical Sciences, U. Manchester, UK. http://eprints.ma.man.ac.uk/1218/01/covered/MIMS_ep2008_26.pdf

Higham, N.~J. (2008). Functions of Matrices: Theory and Computation; Society for Industrial and Applied Mathematics, Philadelphia, PA, USA.

Michael Stadelmann (2009) Matrixfunktionen ... Master's thesis; see reference in expm.Higham08.

See Also

expm.Higham08 for the matrix exponential.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(101)
(A <- matrix(round(rnorm(3^2),1), 3,3))

eA <- expm.Higham08(A)
stopifnot(all.equal(eA, expm::expm(A), tolerance= 1e-15))

C1 <- expmCond(A, "exact")
C2 <- expmCond(A, "1.est")
C3 <- expmCond(A, "F.est")
all.equal(C1$expmCond1, C2$expmCond, tolerance= 1e-15)# TRUE
all.equal(C1$expmCondF, C3$expmCond)# relative difference of 0.001...

Example output

Loading required package: Matrix

Attaching package: 'expm'

The following object is masked from 'package:Matrix':

    expm

     [,1] [,2] [,3]
[1,] -0.3  0.2  0.6
[2,]  0.6  0.3 -0.1
[3,] -0.7  1.2  0.9
[1] "Modes: numeric, NULL"               "Lengths: 1, 0"                     
[3] "target is numeric, current is NULL"
[1] "Modes: numeric, NULL"               "Lengths: 1, 0"                     
[3] "target is numeric, current is NULL"

expm documentation built on May 2, 2019, 5:25 p.m.