53
Rehabilitating Correlations, Avoiding Inversion, and Extracting Roots Nick Higham School of Mathematics The University of Manchester [email protected] @nhigham, nickhigham.wordpress.com http://www.maths.manchester.ac.uk/~higham/talks The Actuarial Profession March 20, 2013, London

Research Matters Nick Higham February 25, 2009 …higham/talks/actuary13.pdfUniversity of Manchester Nick Higham Actuarial Matrix Computations 11 / 37 CorrelationsMatrix InversionMatrix

Embed Size (px)

Citation preview

Research Matters

February 25 2009

Nick HighamDirector of Research

School of Mathematics

1 6

Rehabilitating Correlations AvoidingInversion and Extracting Roots

Nick HighamSchool of Mathematics

The University of Manchester

NicholasJHighammanchesteracuknhigham nickhighamwordpresscom

httpwwwmathsmanchesteracuk~highamtalks

The Actuarial ProfessionMarch 20 2013 London

Precision

SingleDoubleQuadVariable

AccuracyEstimatesGuarantees

Efficiency

SpeedParallelismEnergy efficiency

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 3 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Question from London Fund Management Company (2000)ldquoGiven a real symmetric matrix A which is almost acorrelation matrix

What is the best approximating (in Frobenius norm)correlation matrixIs it uniqueCan we compute it

Typically we are working with 1400times 1400 at the momentbut this will probably grow to 6500times 6500rdquo

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Precision

SingleDoubleQuadVariable

AccuracyEstimatesGuarantees

Efficiency

SpeedParallelismEnergy efficiency

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 3 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Question from London Fund Management Company (2000)ldquoGiven a real symmetric matrix A which is almost acorrelation matrix

What is the best approximating (in Frobenius norm)correlation matrixIs it uniqueCan we compute it

Typically we are working with 1400times 1400 at the momentbut this will probably grow to 6500times 6500rdquo

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 3 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Question from London Fund Management Company (2000)ldquoGiven a real symmetric matrix A which is almost acorrelation matrix

What is the best approximating (in Frobenius norm)correlation matrixIs it uniqueCan we compute it

Typically we are working with 1400times 1400 at the momentbut this will probably grow to 6500times 6500rdquo

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Question from London Fund Management Company (2000)ldquoGiven a real symmetric matrix A which is almost acorrelation matrix

What is the best approximating (in Frobenius norm)correlation matrixIs it uniqueCan we compute it

Typically we are working with 1400times 1400 at the momentbut this will probably grow to 6500times 6500rdquo

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Question from London Fund Management Company (2000)ldquoGiven a real symmetric matrix A which is almost acorrelation matrix

What is the best approximating (in Frobenius norm)correlation matrixIs it uniqueCan we compute it

Typically we are working with 1400times 1400 at the momentbut this will probably grow to 6500times 6500rdquo

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Correlation Matrix

An n times n symmetric matrix A is a correlation matrix ifIt has ones on the diagonalAll its eigenvalues are nonnegative

Is this a correlation matrix1 1 01 1 10 1 1

Spectrum minus04142 10000 24142

University of Manchester Nick Higham Actuarial Matrix Computations 4 37

Question from London Fund Management Company (2000)ldquoGiven a real symmetric matrix A which is almost acorrelation matrix

What is the best approximating (in Frobenius norm)correlation matrixIs it uniqueCan we compute it

Typically we are working with 1400times 1400 at the momentbut this will probably grow to 6500times 6500rdquo

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Question from London Fund Management Company (2000)ldquoGiven a real symmetric matrix A which is almost acorrelation matrix

What is the best approximating (in Frobenius norm)correlation matrixIs it uniqueCan we compute it

Typically we are working with 1400times 1400 at the momentbut this will probably grow to 6500times 6500rdquo

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

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 =

sumij wiwja2

ij )Given approx correlation matrix A find correlationmatrix C to minimize Aminus C

Constraint set is a closed convex set so uniqueminimizer

University of Manchester Nick Higham Actuarial Matrix Computations 6 37

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Development

Derived theory and algorithmN J Higham Computing the Nearest CorrelationMatrixmdashA Problem from Finance IMA J NumerAnal 22 329ndash343 2002

Extensions inCraig Lucas Computing Nearest Covariance andCorrelation Matrices MSc Thesis University ofManchester 2001

University of Manchester Nick Higham Actuarial Matrix Computations 7 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Alternating Projections Algorithmvon Neumann (1933) for subspacesDykstra (1983) corrections for closed convex sets

S1

S2

Easy to implementGuaranteed convergence at a linear rateCan add further constraintsprojections

University of Manchester Nick Higham Actuarial Matrix Computations 8 37

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Unexpected Applications

Some recent papers

Applying stochastic small-scale damage functionsto German winter storms (2012)

Estimating variance components and predictingbreeding values for eventing disciplines andgrades in sport horses (2012)

Characterisation of tool marks on cartridge casesby combining multiple images (2012)

Experiments in reconstructing twentieth-centurysea levels (2011)

University of Manchester Nick Higham Actuarial Matrix Computations 9 37

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Newton Method

Qi amp Sun (2006) Newton method based on theory ofstrongly semismooth matrix functions

Applies Newton to dual (unconstrained) ofmin 1

2Aminus X2F problem

Globally and quadratically convergent

H amp Borsdorf (2010) improve efficiency and reliability

use minres for Newton equationJacobi preconditionerreliability improved by line search tweaksextra scaling step to ensure unit diagonal

University of Manchester Nick Higham Actuarial Matrix Computations 11 37

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Alternating Projections vs Newton

Matrix n tol Code Time (s) Iters1 Random 100 1e-10 g02aa 0023 4

alt proj 0052 152 Random 500 1e-10 g02aa 048 4

alt proj 301 263 Real-life 1399 1e-4 g02aa 68 5

alt proj 1006 68

University of Manchester Nick Higham Actuarial Matrix Computations 14 37

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Performance of NAG Codes

University of Manchester Nick Higham Actuarial Matrix Computations 15 37

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Factor Model (1)

ξ = X︸︷︷︸ntimesk

η︸︷︷︸ktimes1

+ F︸︷︷︸ntimesn

ε︸︷︷︸ntimes1

ηi εi isin N(01)

where var(ξi) equiv 1 F = diag(fii) Implies

ksumj=1

x2ij le 1 i = 1 n

ldquoMultifactor normal copula modelrdquoCollateralized debt obligations (CDOs)Multivariate time series

University of Manchester Nick Higham Actuarial Matrix Computations 16 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 17 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswer

Algorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Factor Structure

Nearest correlation matrix with factor structure

Principal factors method (Andersen et al 2003) has noconvergence theory and can converge to an incorrectanswerAlgorithm based on spectral projected gradientmethod (Borsdorf H amp Raydan 2010)

Respects the constraints exploits their convexityand converges to a feasible stationary pointNAG routine g02aef (Mark 23 2012)

University of Manchester Nick Higham Actuarial Matrix Computations 18 37

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Variations

Specific rank or bound on correlations

Block structure

Bounds on individual correlations

Other requirements

University of Manchester Nick Higham Actuarial Matrix Computations 19 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 20 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Avoiding Inversion

Fundamental Tenet of Numerical AnalysisDonrsquot invert matrices

Ax = b use Gaussian elimination (with pivoting) notx = Aminus1bxT Aminus1y = xT (Aminus1y)

(Aminus1)ii = eTi Aminus1ei

trace(Aminus1) asymp mminus1summk=1 vT

k Aminus1vk vk sim uniformminus11 (Bekas et al 2007)

University of Manchester Nick Higham Actuarial Matrix Computations 21 37

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

How to Invert (1)

Use a condition estimator to warn when A is nearlysingular

gtgt A = hilb(16)gtgt X = inv(A)Warning Matrix is close to singular orbadly scaled Results may be inaccurateRCOND = 9721674e-19

University of Manchester Nick Higham Actuarial Matrix Computations 22 37

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

How to Invert (2)

To compute variancendashcovariance matrix (X T X )minus1 ofleast squares estimator use QR factorization X = QR((X T X )minus1 = Rminus1RminusT ) and do not explicitly form X T X

Quality of computed inverse Y asymp Aminus1 measured by

YAminus IYA

orAY minus IYA

but not both

University of Manchester Nick Higham Actuarial Matrix Computations 23 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Computing the Sample Variance

Sample variance of x1 xn

s2n =

1n minus 1

nsumi=1

(xi minus x)2 where x =1n

nsumi=1

xi (1)

Can compute using one-pass formula

s2n =

1n minus 1

( nsumi=1

x2i minus

1n

( nsumi=1

xi

)2) (2)

For x = (100001000110002) using 8-digit arithmetic(1) gives 10 (2) gives 00

(2) can even give negative results in floating pointarithmetic

University of Manchester Nick Higham Actuarial Matrix Computations 24 37

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Casio fx-992VB

University of Manchester Nick Higham Actuarial Matrix Computations 25 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Spreadsheets in the CloudStandard deviation of x = [n n + 1 n + 2]T

n Exact Google Sheet107 1 1108 1 0

McCullough amp Yalta (2013)

University of Manchester Nick Higham Actuarial Matrix Computations 26 37

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Outline

1 Rehabilitating Correlations

2 Matrix Inversion

3 Matrix Roots

University of Manchester Nick Higham Actuarial Matrix Computations 27 37

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

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)

University of Manchester Nick Higham Actuarial Matrix Computations 28 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 29 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Matrix Roots in Markov Models

Let vectors v2011 v2010 represent risks credit ratings orstock prices in 2011 and 2010Assume a Markov model v2011 = Pv2010 where P is atransition probability matrixP12 enables predictions to be made at 6-monthlyintervals

P12 is matrix X such that X 2 = P What are P23 P09

Ps = exp(s log P)

Problem log P P1k may have wrong sign patternsrArrldquoregularizerdquo

University of Manchester Nick Higham Actuarial Matrix Computations 30 37

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

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 for survey of regularization methods

University of Manchester Nick Higham Actuarial Matrix Computations 31 37

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

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

University of Manchester Nick Higham Actuarial Matrix Computations 32 37

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

MATLAB Arbitrary Power

New Schur algorithm (H amp Lin 2011 2013) reliablycomputes Ap for any real pNew backward-error based inverse scaling andsquaring alg for matrix logarithm (Al-Mohy H ampRelton 2012)mdashfaster and more accurateAlternative 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

University of Manchester Nick Higham Actuarial Matrix Computations 33 37

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Knowledge Transfer Partnership

University of Manchester and NAG (2010ndash2013)funded by EPSRC NAG and TSB

Developing suite of NAG Library codes for matrixfunctions

Extensive set of new codes included in Mark 23 (2012)Mark 24 (2013)

Improvements to existing state of the art faster andmore accurate

My work also supported by curren2M ERC Advanced Grant

University of Manchester Nick Higham Actuarial Matrix Computations 34 37

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

Correlations Matrix Inversion Matrix Roots

Final Remarks

Fast moving developments in numerical linear algebraalgorithms

Numerical reliability is essential

Partnership with NAG enables rapid inclusion of ouralgorithms in the NAG Library

Keen to hear about your matrix problems

University of Manchester Nick Higham Actuarial Matrix Computations 37 37

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References I

A H Al-Mohy and N J HighamImproved inverse scaling and squaring algorithms forthe matrix logarithmSIAM J Sci Comput 34(4)C153ndashC169 2012

A H Al-Mohy N J Higham and S D ReltonComputing the Freacutechet derivative of the matrix logarithmand estimating the condition numberMIMS EPrint 201272 Manchester Institute forMathematical Sciences The University of ManchesterUK July 201217 ppRevised December 2012

University of Manchester Nick Higham Actuarial Matrix Computations 1 8

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References II

L Anderson J Sidenius and S BasuAll your hedges in one basketRisk pages 67ndash72 Nov 2003|wwwrisknet|

C Bekas E Kokiopoulou and Y SaadAn estimator for the diagonal of a matrixAppl Numer Math 571214ndash1229 2007

R Borsdorf N J Higham and M RaydanComputing a nearest correlation matrix with factorstructureSIAM J Matrix Anal Appl 31(5)2603ndash2622 2010

University of Manchester Nick Higham Actuarial Matrix Computations 2 8

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References III

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

T CrillyArthur Cayley Mathematician Laureate of the VictorianAgeJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8011-4xxi+610 pp

University of Manchester Nick Higham Actuarial Matrix Computations 3 8

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References IV

P Glasserman and S SuchintabandidCorrelation expansions for CDO pricingJournal of Banking amp Finance 311375ndash1398 2007

C-H Guo and N J HighamA SchurndashNewton method for the matrix pth root and itsinverseSIAM J Matrix Anal Appl 28(3)788ndash804 2006

University of Manchester Nick Higham Actuarial Matrix Computations 4 8

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References V

N J HighamAccuracy and Stability of Numerical AlgorithmsSociety for Industrial and Applied MathematicsPhiladelphia PA USA second edition 2002ISBN 0-89871-521-0xxx+680 pp

N J HighamComputing the nearest correlation matrixmdashA problemfrom financeIMA J Numer Anal 22(3)329ndash343 2002

University of Manchester Nick Higham Actuarial Matrix Computations 5 8

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References VI

N J Higham and L LinOn pth roots of stochastic matricesLinear Algebra Appl 435(3)448ndash463 2011

N J Higham and L LinAn improved SchurndashPadeacute algorithm for fractionalpowers of a matrix and their Freacutechet derivativesMIMS EPrint 20131 Manchester Institute forMathematical Sciences The University of ManchesterUK Jan 201320 pp

University of Manchester Nick Higham Actuarial Matrix Computations 6 8

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References VII

L LinRoots of Stochastic Matrices and Fractional MatrixPowersPhD thesis The University of Manchester ManchesterUK 2010117 ppMIMS EPrint 20119 Manchester Institute forMathematical Sciences

B D McCullough and A T YaltaSpreadsheets in the cloudmdashnot ready yetJournal of Statistical Software 521ndash14 2013

University of Manchester Nick Higham Actuarial Matrix Computations 7 8

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix

References VIII

K H ParshallJames Joseph Sylvester Jewish Mathematician in aVictorian WorldJohns Hopkins University Press Baltimore MD USA2006ISBN 0-8018-8291-5xiii+461 pp

H-D Qi and D SunA quadratically convergent Newton method forcomputing the nearest correlation matrixSIAM J Matrix Anal Appl 28(2)360ndash385 2006

University of Manchester Nick Higham Actuarial Matrix Computations 8 8

  • Rehabilitating Correlations
  • Matrix Inversion
  • Matrix Roots
  • Appendix