擅长:python、mysql、java
<p>Cholesky分解创建一个下三角矩阵。这意味着在<code>np.dot</code>中完成的乘法有将近一半不需要执行。如果你换线</p>
<pre><code>betas_cand[con] = betas[con] + s * np.dot(conLSigma, np.random.standard_normal(size = nX))
</code></pre>
<p>进入</p>
^{pr2}$
<p>但是,你也需要改变</p>
^{3}$
<p>进入</p>
<pre><code>cdef np.ndarray betas_cand = np.array(betas)
</code></pre>
<p>当然,您可以使用切片进行乘法运算,但我不确定它是否会比我建议的更快。不管怎样,希望你能明白。我不认为你还能做什么来加速这个过程。在</p>