Mfasi

Joined 28 February 2014
21 bytes removed ,  16 March 2014
Line 62: Line 62:
* The project I would like to work on is '''Improve logm, sqrtm, funm'''.
* The project I would like to work on is '''Improve logm, sqrtm, funm'''.


Basically, I would like to provide Octave with an (almost) state of the art library to compute the most diffused matrix functions in a robust way. Octave's standard library as well as the linear algebra package (Octave Forge) already implement some of these functions, notably funm (), expm (), logm() and sqrtm(). Some of these implementations are good, while others should be improved or, in some cases, completely reimplemented.
Basically, I would like to provide Octave with an (almost) state of the art library to compute the most diffused matrix functions in a robust way. Octave's standard library as well as the linear algebra package (Octave Forge) already implement some of these functions, notably funm (), expm (), logm() and sqrtm(). Some of these implementations are good, while others should be improved or, in some cases, completely rewritten.


One of the functions that should be completely rewritten is probably funm (), that is currently implemented using a simple but in some cases weak approach inspired by the definition of matrix function via the Jordan canonical form. This approach fails when the matrix is not diagonalizable and can be very inaccurate when the eigenvectors are ill-conditioned. To avoid these issues I would like to use the Schur-Parlett recurrence with block reordering, a well known algorithm that though having some issues that should be addressed, is in theory very robust. This implementation will require to:
One of the functions that should be completely reimplemented is probably funm (), that currently uses a simple but in some cases weak approach inspired by the definition of matrix function via the Jordan canonical form. This approach fails when the matrix is not diagonalizable and can be very inaccurate when the eigenvectors are ill-conditioned. To avoid these issues I would like to use the Schur-Parlett recurrence with block reordering, a well known algorithm that though having some issues that should be addressed, is theoretically robust. This implementation will require to:


* modify the Schur function to deal with a specific reordering of the eigenvalues;
* modify the Schur function to deal with a specific reordering of the eigenvalues;
* implement a function that evaluates matrix polynomials using the Paterson-Stockmeyer scheme;
* implement a function that evaluates matrix polynomials using the Paterson-Stockmeyer scheme;
* implement a function to find a block pattern (how to group the eigenvalues of the Schur form);
* implement a function to find a block pattern (how to group the eigenvalues of the Schur form);
* implement a function to find a confluent permutation (of course, this is a very specific task).
* implement a function to find a confluent permutation (a very specific task).


The following functions that should be addressed are expm (), logm () and sqrtm (). The implementation of the first function is stable, using Padé approximants, but could be improved using an heuristic that switches to some other kind of evaluation when such rational functions are ill-conditioned. The logm () functions is a recent implementation and uses a scaling and squaring method. Maybe some little improvements can be done, but I would not put them between the priorities. I would not touch sqrtm () either, since it seems to be a good C++ implementation of an algorithm by Higham that should be very similar to the one in Matlab. I would instead focus on developing the p-th root, as there is a [http://poisson.phc.unipi.it/~maxreen/bruno/pdf/B.%20Iannazzo%20and%20C.%20Manasse%20-%20A%20Schur%20logarithmic%20algorithm%20for%20fractional%20powers%20of%20matrices%20-%20SIMAX.pdf recent work] that seems promising, though being rather involved could be tricky to implement in a robust way.
The functions that should be addressed after that one are expm (), logm () and sqrtm (). The implementation of the first function is stable as it exploits Padé approximants, but could be improved using an heuristic that switches to some other kind of evaluation when such rational functions are ill-conditioned. The logm () functions is a recent implementation and uses a scaling and squaring method. Maybe some little improvements can be done, but I would not put them between the priorities. I would not touch sqrtm () either, since it seems to be a good C++ implementation of an algorithm by Higham that should be very similar to the one in Matlab. I would instead focus on developing the p-th root, as there is a [http://poisson.phc.unipi.it/~maxreen/bruno/pdf/B.%20Iannazzo%20and%20C.%20Manasse%20-%20A%20Schur%20logarithmic%20algorithm%20for%20fractional%20powers%20of%20matrices%20-%20SIMAX.pdf recent work] that seems promising, though being rather involved it could be tricky to implement in a robust way.


The hyperbolic and trigonometric functions have already been implemented straightforwardly in thfm (), from the linear-algebra package. As they rely on sqrtm (), expm () and logm (), they will benefit of all the improvements to such functions.
The hyperbolic and trigonometric functions have already been written down straightforwardly in thfm (), from the linear-algebra package. As it relies on sqrtm (), expm () and logm (), it will benefit of all the improvements to such functions.


==== Tentative timeline ====
==== Tentative timeline ====
Line 83: Line 83:
* 30 May: Implementation of the auxiliary functions required for '''funm ()''' (see above)
* 30 May: Implementation of the auxiliary functions required for '''funm ()''' (see above)


* '''23 June''': Implementation of '''funm ()''', improvement of '''expm ()''' and '''logm ()'''
* '''23 June''': Implementation of '''funm ()'''


* 31 July: Implementation of '''rootm ()''' and check of the functionalities of '''thfm ()'''
* 31 July: Improvement of '''expm ()''' and '''logm ()''', implementation of '''rootm ()''' and check of the functionalities of '''thfm ()'''


* 7 August: Testing, implementation of eventual optimizations left behind
* 7 August: Testing, implementation of eventual optimizations left behind
102

edits