Forgot to cc the octdev list so here is my last message. /F
[EMAIL PROTECTED] wrote: > > > I don't know the numerical details of the different methods (e.g. > chol2logdet vs. qr2logdet). In a similar way, I don't know if I should > invert a matrix using SVD or QR. I really love that when I compute the > inverse of a matrix using 'inv', Octave chooses the best method (or at > least it tries to). I'd prefer if a 'logdet' function chose the best > method (chol2logdet, qr2logdet, lu2logdet,...) by looking at some > matrix characteristics. If this is possible then I'd doubt that the > 'logdet' function would be a simple one-liner. > Yes that would be preferable but I don't think Octave (3.0.0) keeps track of if the matrix is symmetric (pos def), at least a test I did with for example, octave:3> A = randn(3000,3000); octave:4> tic,Q = A'*A;toc Elapsed time is 4.22683 seconds. don't seem to use that Q is symmetric since a when I call the BLAS function syrk (which is for symmetric matrix mult.) I get: octave:5> tic,Q = syrk(A,'T');toc Elapsed time is 2.31874 seconds. (the syrk function is an oct-function that I wrote to call the corresponding BLAS function). >> Perhaps we could consider creating a Wiki page named >> "OctaveTricks", "OctavePearls" or something like that, that would >> gather such useful tricks, one- or several-liners, avoiding the cost >> of creating a whole function, which should contain documentation, >> argument & error checks, and tests. A companion Octave-Forge package >> (again, OctaveTricks or OctavePearls), updated from time to time, >> could gather these expressions. The process can certainly be automated >> to some extent. >> In this way, anyone can mail "look, I've found a cool way to compute a >> log determinant from Cholesky decomposition, like this:" without >> necessarily getting a password and being registered as OctaveForge >> developer, >> and we could simply add to the wiki and/or the package >> >> # turn a Cholesky decomposition into log-determinant (fast, avoids overflows) >> # thanks to Fredrik Lingvall <[EMAIL PROTECTED]> >> chol2logdet = @(R) 2*sum(log(diag(R))); >> >> >> what do you think of this idea? >> We can actually start straight away with the wiki page, the above can >> be the first entry. >> > > I think such a wiki page would be nice to have. > Yes I agree. Also, since this is rather common operations in statistics apps it should perhaps go into the user manual for the statistics package too. Jaroslav, Can you come up with a draft for the logdet-function (with parameters 'posdef', 'L', 'R' etc.)? /Fredrik ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev