我正在寻找半-definite矩阵在python中的Cholesky/LDL分解。
搜索结果:
numpy.linalg.cholesky
和sympy.Matrix.LDLdecomposition
只适用于正定。我的实例相当小,大约是$100\times100$,所以一个象征性的解决方案很好(瓶颈在其他地方)。
发布于 2017-09-07 16:20:30
你可以用LU分解。对于对称矩阵或hermitian矩阵,它们等价于某些符号歧义。
发布于 2018-05-05 21:46:38
使用SciPy v1.1.0
和更高版本,您可以使用scipy.linalg.ldl
对不定矩阵进行分解。
示例:创建正定矩阵arr
>>> import numpy as np
>>> import scipy.linalg as la
>>> arr = np.random.rand(100,97)
>>> M = arr @ arr.T
>>> l, d, p = la.ldl(M)
>>> np.allclose(l.dot(d).dot(l.T) - M, np.zeros([100, 100]))
True
https://stackoverflow.com/questions/46100441
复制相似问题