Determinant of a (large) 1554 x 1554 matrix in Python
<p>I need to calculate the determinant of a large 1554,1554 matrix of values with single precision in python. In doing so I encounter a runtime warning:</p>

<pre><code>import numpy as np

from numpy import linalg as LA

a = np.random.random((1554, 1554))

b = np.random.random((1554, 1554))

c = np.dot(a,b)

det = LA.det(c)
</code></pre>

<blockquote>
  <p>RuntimeWarning: overflow encountered in det
    r = _umath_linalg.det(a, signature=signature)</p>
</blockquote>

<p>Any ideas on how I can work around this problem? Many thanks!</p>

<p>Edit: this question is unique in that it specifically refers to computing the determinant of large matrix in double precision, though a possible answer is included here: <a href="http://stackoverflow.com/questions/462500/can-i-get-the-matrix-determinant-using-numpy">Can I get the matrix determinant using Numpy?</a></p>

<p>You can use this relation: <a href="https://wikimedia.org/api/rest_v1/media/math/render/svg/f6404a766d86e9d78a5c4f82e05de37469a5f8e9" rel="nofollow">https://wikimedia.org/api/rest_v1/media/math/render/svg/f6404a766d86e9d78a5c4f82e05de37469a5f8e9</a></p>

<p>from <a href="https://en.wikipedia.org/wiki/Determinant#Properties_of_the_determinant" rel="nofollow">https://en.wikipedia.org/wiki/Determinant#Properties_of_the_determinant</a></p>

<p>So divide your matrix by the mean and then compute the determinant to avoid overflow. Later you can multiply with the mean to the power of n (length of one axis)</p>

<p>edit: I'm not sure if the mean is the ideal choice though. This is more a math question</p>

python numpy matrix