matlab - 在 numpy 中使用矩阵求逆的正确(稳定、有效)方法是什么?

标签 matlab numpy scipy linear-algebra matrix-inverse

<分区>

在 Matlab 中,由于数值不稳定,通常不鼓励使用 inv() 函数(参见 http://www.mathworks.com/help/matlab/ref/inv.html 中的描述部分)。 建议替换如下表达式:

inv(A)*B 

(其中 A 和 B 都是矩阵),其中:

A\B

当逆矩阵 A 接近奇异时,这变得很关键。

在 numpy/scipy 中有没有好的写法? (会解决()工作吗?)

最佳答案

如评论中所述,您需要使用左逆。

这在 this question 中有描述.

总结(模仿,模仿):

关于matlab - 在 numpy 中使用矩阵求逆的正确(稳定、有效)方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17136626/

相关文章:

string - Matlab:使用字符串作为if语句的条件

matlab - 如何使用牛顿法求解积分的上限?

python - 使用默认值填充数据框列,其中 findall 不返回任何匹配项

python - 如何将 coo_matrix 与列 numpy 数组连接

python - python scipy 中样条线与平面的相交

matlab - 我需要在调用 fft 或 ifft 之前调用 fftshift 吗?

arrays - matlab 行标签到列标签

python - numpy 错误 :TypeError: only length-1 arrays can be converted to Python scalars

python - 从 numpy 数组创建值频率字典

python - scipy.stats.chisquare 没有给出输入数据预期的结果