Is there any code available for python with 'cholupdate''s functionality that's compatible with numpy? from choldate import cholupdate, choldowndate import numpy #Create a random positive definite matrix, V numpy.random.seed(1) X = numpy.random.normal(size=(100,10)) V = numpy.dot(X.transpose(), X) #Calculate the upper Cholesky factor, R R = numpy.linalg.cholesky(V).transpose() #Create a random update vector, u u = numpy.random.normal(size=R.shape) #Calculate the updated positive definite matrix, V1, and its Cholesky factor, R1 V1 = V numpy.outer(u,u) R1 = numpy.linalg.cholesky(V1).transpose() #The following is equivalent to the above R1_ = R.copy() cholupdate(R1_,u.copy()) assert(numpy.all((R1 - R1_)**2 This should do a rank-1 update or downdate on numpy arrays R and x with sign ' ' or '-' corresponding to update or downdate.
(Ported from MATLAB cholupdate at the Wikipedia page: def cholupdate(R,x,sign): import numpy as np p = np.size(x) x = x.
We already have the necessary components and the algorithm is fairly simple. Some quality time with the API docs and/or headers along with and looking at the existing bindings in https://github.com/Julia Lang/julia/blob/master/base/sparse/should get you started.
If the system matrix is symmetric positive definite, it is almost always possible to use a representation based on the Cholesky decomposition which renders the same results (in exact arithmetic) at the same or less operational cost, but typically is much more numerically stable.Matlab offers this functionality as a function called 'cholupdate'.LINPACK also has this functionality, but it has (to my knowledge) not yet been ported to LAPACK and hence isn't available in e.g. I found out that scikits.sparse offers a similar function based on CHOLMOD, but my matrices are dense.In linear algebra, the Cholesky decomposition or Cholesky factorization is a decomposition of a Hermitian, positive-definite matrix into the product of a lower triangular matrix and its conjugate transpose, which is useful e.g.for efficient numerical solutions and Monte Carlo simulations.