research matters nick higham february 25, 2009 school of
TRANSCRIPT
Research Matters
February 25 2009
Nick HighamDirector of Research
School of Mathematics
1 6
Functions of Matrices andNearest Correlation Matrices
Nick HighamSchool of Mathematics
The University of Manchester
highammamanacukhttpwwwmamanacuk~higham
What is a Matrix Function
Itrsquos not
det(A) or trace(A)elementwise evaluation f (aij)AT matrix factor (eg A = LU)
It is
Aminus1eAradic
A
MIMS Nick Higham Matrix Functions 2 33
What is a Matrix Function
Itrsquos not
det(A) or trace(A)elementwise evaluation f (aij)AT matrix factor (eg A = LU)
It is
Aminus1eAradic
A
MIMS Nick Higham Matrix Functions 2 33
Cayley and Sylvester
Term ldquomatrixrdquo coined in 1850by James Joseph SylvesterFRS (1814ndash1897)
Matrix algebra developed byArthur Cayley FRS (1821ndash1895)Memoir on the Theory of Ma-trices (1858)
MIMS Nick Higham Matrix Functions 3 33
Cayley and Sylvester on Matrix Functions
Cayley considered matrix squareroots in his 1858 memoir
Tony Crilly Arthur Cayley Mathemati-cian Laureate of the Victorian Age2006
Sylvester (1883) gave first defini-tion of f (A) for general f
Karen Hunger Parshall James JosephSylvester Jewish Mathematician in aVictorian World 2006
MIMS Nick Higham Matrix Functions 4 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
What is a Matrix Function
Itrsquos not
det(A) or trace(A)elementwise evaluation f (aij)AT matrix factor (eg A = LU)
It is
Aminus1eAradic
A
MIMS Nick Higham Matrix Functions 2 33
What is a Matrix Function
Itrsquos not
det(A) or trace(A)elementwise evaluation f (aij)AT matrix factor (eg A = LU)
It is
Aminus1eAradic
A
MIMS Nick Higham Matrix Functions 2 33
Cayley and Sylvester
Term ldquomatrixrdquo coined in 1850by James Joseph SylvesterFRS (1814ndash1897)
Matrix algebra developed byArthur Cayley FRS (1821ndash1895)Memoir on the Theory of Ma-trices (1858)
MIMS Nick Higham Matrix Functions 3 33
Cayley and Sylvester on Matrix Functions
Cayley considered matrix squareroots in his 1858 memoir
Tony Crilly Arthur Cayley Mathemati-cian Laureate of the Victorian Age2006
Sylvester (1883) gave first defini-tion of f (A) for general f
Karen Hunger Parshall James JosephSylvester Jewish Mathematician in aVictorian World 2006
MIMS Nick Higham Matrix Functions 4 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
What is a Matrix Function
Itrsquos not
det(A) or trace(A)elementwise evaluation f (aij)AT matrix factor (eg A = LU)
It is
Aminus1eAradic
A
MIMS Nick Higham Matrix Functions 2 33
Cayley and Sylvester
Term ldquomatrixrdquo coined in 1850by James Joseph SylvesterFRS (1814ndash1897)
Matrix algebra developed byArthur Cayley FRS (1821ndash1895)Memoir on the Theory of Ma-trices (1858)
MIMS Nick Higham Matrix Functions 3 33
Cayley and Sylvester on Matrix Functions
Cayley considered matrix squareroots in his 1858 memoir
Tony Crilly Arthur Cayley Mathemati-cian Laureate of the Victorian Age2006
Sylvester (1883) gave first defini-tion of f (A) for general f
Karen Hunger Parshall James JosephSylvester Jewish Mathematician in aVictorian World 2006
MIMS Nick Higham Matrix Functions 4 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Cayley and Sylvester
Term ldquomatrixrdquo coined in 1850by James Joseph SylvesterFRS (1814ndash1897)
Matrix algebra developed byArthur Cayley FRS (1821ndash1895)Memoir on the Theory of Ma-trices (1858)
MIMS Nick Higham Matrix Functions 3 33
Cayley and Sylvester on Matrix Functions
Cayley considered matrix squareroots in his 1858 memoir
Tony Crilly Arthur Cayley Mathemati-cian Laureate of the Victorian Age2006
Sylvester (1883) gave first defini-tion of f (A) for general f
Karen Hunger Parshall James JosephSylvester Jewish Mathematician in aVictorian World 2006
MIMS Nick Higham Matrix Functions 4 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Cayley and Sylvester on Matrix Functions
Cayley considered matrix squareroots in his 1858 memoir
Tony Crilly Arthur Cayley Mathemati-cian Laureate of the Victorian Age2006
Sylvester (1883) gave first defini-tion of f (A) for general f
Karen Hunger Parshall James JosephSylvester Jewish Mathematician in aVictorian World 2006
MIMS Nick Higham Matrix Functions 4 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Two Definitions
Definition (Taylor series)
If f has a Taylor series expansion f (z) =suminfin
k=0 akzk withradius of convergence r and ρ(A) lt r then
f (A) =infinsum
k=0
akAk
Definition (Cauchy integral formula)
f (A) =1
2πi
intΓ
f (z)(zI minus A)minus1 dz
where f analytic on and inside closed contour Γ enclosingλ(A)
MIMS Nick Higham Matrix Functions 5 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Matrices in Applied Mathematics
Frazer Duncan amp Collar Aerodynamics Division ofNPL aircraft flutter matrix structural analysis
Elementary Matrices amp Some Applications toDynamics and Differential Equations 1938Emphasizes importance of eA
Arthur Roderick Collar FRS(1908ndash1986) ldquoFirst book to treatmatrices as a branch of appliedmathematicsrdquo
MIMS Nick Higham Matrix Functions 6 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Solving Ordinary Differential Equations
d2ydt2 + Ay = 0 y(0) = y0 y prime(0) = y prime0
has solution
y(t) = cos(radic
At)y0 +(radic
A)minus1 sin(
radicAt)y prime0
But also [y prime
y
]= exp
([0 minustA
t In 0
])[y prime0y0
]
MIMS Nick Higham Matrix Functions 8 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Phi Functions Definition
ϕ0(z) = ez ϕ1(z) =ez minus 1
z ϕ2(z) =
ez minus 1minus zz2
ϕk+1(z) =ϕk(z)minus 1k
z
ϕk(z) =infinsum
j=0
z j
(j + k)
MIMS Nick Higham Matrix Functions 9 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Phi Functions Solving ODEs
y isin Cn A isin Cntimesn
dydt
= Ay y(0) = y0 rArr y(t) = eAty0
dydt
= Ay + b y(0) = 0 rArr y(t) = t ϕ1(tA)b
dydt
= Ay + ct y(0) = 0 rArr y(t) = t2ϕ2(tA)c
MIMS Nick Higham Matrix Functions 10 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Exponential Integrators
Considery prime = Ly + N(y)
N(y(t)) asymp N(y(0)) implies
y(t) asymp etLy0 + tϕ1(tL)N(y(0))
Exponential Euler method
yn+1 = ehLyn + hϕ1(hL)N(yn)
Lawson (1967) recent resurgence
MIMS Nick Higham Matrix Functions 11 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Toolbox of Matrix Functions
Want software for evaluating interesting f at matrix argsas well as scalar argsMATLAB has expm logm sqrtm funmThe Matrix Function Toolbox (H 2008)NAG Library
f01ecf (f01ecc) for matrix exponentialf01efff01fff for function ofsymmetricHermitian matrixMore on the way
MIMS Nick Higham Matrix Functions 12 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Scaling and Squaring Method
Scale B larr A2s so Binfin asymp 1Approximate rm(B) = [mm] Padeacute approximant to eB
Square X = rm(B)2s asymp eA
Moler amp Van Loan (1978) ldquoNineteen dubious ways tocompute the exponential of a matrixrdquomdashmethodology forchoosing s and mH (2005) sharper analysis giving optimal s and mAl-Mohy amp H (2009) further improvements
MIMS Nick Higham Matrix Functions 13 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Compute eAb
Exploit for integer s
eAb = (esminus1A)sb = esminus1Aesminus1A middot middot middot esminus1A︸ ︷︷ ︸s times
b
Choose s so Tm(sminus1A) =summ
j=0(sminus1A)j
jasymp esminus1A Then
bi+1 = Tm(sminus1A)bi i = 0 s minus 1 b0 = b
yields bs asymp eAb
Al-Mohy amp H (2011) SIAM J Sci Comp
MIMS Nick Higham Matrix Functions 14 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
ExperimentCompute etAb for HarwellndashBoeing matrices
orani678 n = 2529 t = 100 b = [11 1]T bcspwr10 n = 5300 t = 10 b = [10 01]T
2D Laplacian matrix poisson tol = 6times 10minus8
Alg AH ode15stime cost error time cost error
orani678 013 878 4e-8 136 7780+ middot middot middot 2e-6bcspwr10 0021 215 7e-7 292 1890+ middot middot middot 5e-5poisson 376 29255 2e-6 248 402+ middot middot middot 8e-6
4poisson 15 116849 9e-6 324 49+ middot middot middot 1e-1
MIMS Nick Higham Matrix Functions 15 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
General Functions
SchurndashParlett algorithm (Davies amp H 2003)computes f (A) given the ability to evaluate f (k)(x) forany k and x Implemented in MATLABrsquos funmBeware unstable diagonalization algorithmfunction F = funm_ev(Afun)FUNM_EV Evaluate general matrix function via eigensystem[VD] = eig(A)F = V diag(feval(fundiag(D))) V
MIMS Nick Higham Matrix Functions 16 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Email from a Power Company
The problem has arisen through proposedmethodology on which the company will incurcharges for use of an electricity network
I have the use of a computer and Microsoft Excel
I have an Excel spreadsheet containing thetransition matrix of how a companyrsquos [Standard ampPoorrsquos] credit rating changes from one year to thenext Irsquod like to be working in eighths of a year sothe aim is to find the eighth root of the matrix
MIMS Nick Higham Matrix Functions 17 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Chronic Disease Example
Estimated 6-month transition matrixFour AIDS-free states and 1 AIDS state2077 observations (Charitos et al 2008)
P =
08149 00738 00586 00407 0012005622 01752 01314 01169 0014303606 01860 01521 02198 0081501676 00636 01444 04652 01592
0 0 0 0 1
Want to estimate the 1-month transition matrix
Λ(P) = 1096440498001493minus00043
H amp Lin (2011)Lin (2011 Chap 3 for survey of regularizationmethods
MIMS Nick Higham Matrix Functions 18 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
MATLAB Arbitrary Powers
gtgt A = [1 1e-8 0 1]A =10000e+000 10000e-008
0 10000e+000
gtgt A^01ans =
1 00 1
gtgt expm(01logm(A))ans =
10000e+000 10000e-0090 10000e+000
MIMS Nick Higham Matrix Functions 19 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
MATLAB Arbitrary Power
New Schur algorithm (H amp Lin 2011) reliablycomputes Ap for any real pBrings improvements over MATLAB Ap even fornegative integer pAlternative Newton-based algorithms available for A1q
with q an integer eg for
Xk+1 =1q[(q + 1)Xk minus X q+1
k A]
X0 = A
Xk rarr Aminus1q
MIMS Nick Higham Matrix Functions 20 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
EPSRC Knowledge Transfer Partnership
University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSBDeveloping suite of NAG Library codes for matrixfunctionsKTP Associate Edvin DeadmanImprovements to existing state of the artSuggestions for prioritizing code developmentwelcome
MIMS Nick Higham Matrix Functions 21 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
ERC Advanced Grant MATFUN
Functions of Matrices Theory and Computation2011ndash2015 (value curren2M)3 postdocs 2 PhD students international visitors2 workshopsNew algorithms will be developed
MIMS Nick Higham Matrix Functions 22 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Questions From Finance Practitioners
ldquoGiven a real symmetric matrix A which is almost acorrelation matrix what is the best approximating(in Frobenius norm) correlation matrixrdquo
ldquoI am researching ways to make our companyrsquoscorrelation matrix positive semi-definiterdquo
ldquoCurrently I am trying to implement some realoptions multivariate models in a simulationframework Therefore I estimate correlationmatrices from inconsistent data set whicheventually are non psdrdquo
MIMS Nick Higham Matrix Functions 23 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Correlation Matrix
An n times n symmetric positive semidefinite matrix A withaii equiv 1
Properties
symmetric1s on the diagonaloff-diagonal elements between minus1 and 1eigenvalues nonnegative
Is this a correlation matrix1 1 01 1 10 1 1
Spectrum minus04142 10000 24142
MIMS Nick Higham Matrix Functions 24 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
How to Proceed
times Make ad hoc modifications to matrix eg shiftnegative ersquovals up to zero then diagonally scale
radicPlug the gaps in the missing data then compute anexact correlation matrix
radicCompute the nearest correlation matrix in theweighted Frobenius norm (A2
F =sum
ij wiwja2ij )
Constraint set is a closed convex set so uniqueminimizer
MIMS Nick Higham Matrix Functions 25 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Alternating Projections
von Neumann (1933) for subspaces
S1
S2
Dykstra (1983) incorporated corrections for closed convexsets
MIMS Nick Higham Matrix Functions 26 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Newton Method
Qi amp Sun (2006) convergent Newton method basedon theory of strongly semismooth matrix functionsGlobally and quadratically convergentVarious algorithmic improvements by Borsdorf amp H(2010)Implemented in NAG codes g02aaf (g02aac) andg02abf (weights lower bound on eirsquovalsmdashMark 23)
MIMS Nick Higham Matrix Functions 27 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Factor Model (1)
ξ = X︸︷︷︸ntimesk
η︸︷︷︸ktimes1
+ F︸︷︷︸ntimesn
ε︸︷︷︸ntimes1
ηi εi isin N(01)
where F = diag(fii) Implies
ksumj=1
x2ij le 1 i = 1 n
ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series
MIMS Nick Higham Matrix Functions 28 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Factor Model (2)
Yields correlation matrix of form
C(X ) = D + XX T = D +ksum
j=1
xjxTj
D = diag(I minus XX T ) X = [x1 xk ]
C(X ) has k factor correlation matrix structure
C(X ) =
1 yT
1 y2 yT1 yn
yT1 y2 1
yT
nminus1yn
yT1 yn yT
nminus1yn 1
yi isin Rk
MIMS Nick Higham Matrix Functions 29 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
k Factor Problem
minXisinRntimesk
f (x) = Aminus C(X )2F subject to
ksumj=1
x2ij le 1
Nonlinear objective function with convex quadraticconstraintsSome existing algs ignore the constraints
MIMS Nick Higham Matrix Functions 31 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Algorithms
Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2011)
Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23)
Principal factors method (Andersen et al 2003) hasno convergence theory and can converge to anincorrect answer
MIMS Nick Higham Matrix Functions 32 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
Conclusions
Matrix functions a powerful and versatile tool withexcellent algs availableBeware unstableimpractical algs in literature
MATLAB f (A) algs were last updated 2006Currently implementing state of the art f (A) algs forNAG Library via the KTP
Excellent algs available for nearest correlation matrixproblemsBeware algs in literature that may not converge orconverge to wrong solution
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References I
A H Al-Mohy and N J HighamA new scaling and squaring algorithm for the matrixexponentialSIAM J Matrix Anal Appl 31(3)970ndash989 2009
A H Al-Mohy and N J HighamComputing the action of the matrix exponential with anapplication to exponential integratorsSIAM J Sci Comput 33(2)488ndash511 2011
L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|
MIMS Nick Higham Matrix Functions 25 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References II
R Borsdorf and N J HighamA preconditioned Newton algorithm for the nearestcorrelation matrixIMA J Numer Anal 30(1)94ndash107 2010
R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010
T Charitos P R de Waal and L C van der GaagComputing short-interval transition matrices of adiscrete-time Markov chain from partially observeddataStatistics in Medicine 27905ndash921 2008
MIMS Nick Higham Matrix Functions 26 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References III
T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp
P I Davies and N J HighamA SchurndashParlett algorithm for computing matrixfunctionsSIAM J Matrix Anal Appl 25(2)464ndash485 2003
MIMS Nick Higham Matrix Functions 27 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References IV
R A Frazer W J Duncan and A R CollarElementary Matrices and Some Applications toDynamics and Differential EquationsCambridge University Press Cambridge UK 1938xviii+416 pp1963 printing
P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007
N J HighamThe Matrix Function Toolboxhttpwwwmamanacuk~highammftoolbox
MIMS Nick Higham Matrix Functions 28 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References V
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM J Matrix Anal Appl 26(4)1179ndash1193 2005
N J HighamFunctions of Matrices Theory and ComputationSociety for Industrial and Applied MathematicsPhiladelphia PA USA 2008ISBN 978-0-898716-46-7xx+425 pp
MIMS Nick Higham Matrix Functions 29 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References VI
N J HighamThe scaling and squaring method for the matrixexponential revisitedSIAM Rev 51(4)747ndash764 2009
N J Higham and A H Al-MohyComputing matrix functionsActa Numerica 19159ndash208 2010
MIMS Nick Higham Matrix Functions 30 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References VII
N J Higham and L LinA SchurndashPadeacute algorithm for fractional powers of amatrixMIMS EPrint 201091 Manchester Institute forMathematical Sciences The University of ManchesterUK Oct 201025 ppTo appear in SIAM J Matrix Anal Appl
N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011
MIMS Nick Higham Matrix Functions 31 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References VIII
J D LawsonGeneralized Runge-Kutta processes for stable systemswith large Lipschitz constantsSIAM J Numer Anal 4(3)372ndash380 Sept 1967
L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences
MIMS Nick Higham Matrix Functions 32 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33
References IX
K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp
MIMS Nick Higham Matrix Functions 33 33