Quote:
Originally Posted by Ether
Any questions?
|
I don't have any experience with R (on my to do list though). Here is what I think is going on, please correct me if I am wrong.
Stacy Irwin used Rs "solve" method to calculate season OPRs, more info
here. She created functions to generate the A and b matrices and used R's "solve" method to get OPRs. I'm having trouble finding good documentation on this method, the best I could get was
this. The problem is that this method requires A to be square, which it isn't. This method seems to use LU decomposition. Solving for OPRs after creating the A and b matrices took approximately 3 seconds.
You used the
sparseM package to calculate season OPRs. The key difference from Stacy's method was that you converted the A matrix into a sparse matrix and then used the slm method to get OPRs. This method uses Cholesky decomposition. Solving for OPRs after creating the A and b matrices took approximately 0.50 seconds.
These results are roughly in line with the fact that Cholesky decomposition is around twice as fast as LU decomposition.
Quote:
from Wikipedia
The [Cholesky decomposition] algorithms described below all involve about (n^3)/3 FLOPs, where n is the size of the matrix A. Hence, they are half the cost of the LU decomposition, which uses (2n^3)/3 FLOPs (see Trefethen and Bau 1997).
|