View Single Post
  #5   Spotlight this post!  
Unread 05-01-2017, 13:27
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is offline
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,042
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
Re: fast OPR computation with R using sparse matrix technology

Quote:
Originally Posted by Ether View Post

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).
Reply With Quote