I'm translating some code from MATLAB to Python and I'm stuck with the corrmtx() MATLAB function. Is there any similar function in Python, or how could I replace it?
-
Maybe this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.corrcoef.html ? This is just an attempt to Google it, I don't know anything about this. – Eric Wilson Jul 20 '11 at 18:19
3 Answers
-
-
There's is not a version for windows? It seems like that there's just the linux version. – Rodrigo Forti Jul 20 '11 at 18:50
-
1This is the source version. Compiling on Windows should be possible, too. – schlamar Jul 20 '11 at 18:52
How about:
http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.toeplitz.html
The matlab docs for corrmtx
state:
X = corrmtx(x,m) returns an (n+m)-by-(m+1) rectangular Toeplitz matrix X, such that X'X is a (biased) estimate of the autocorrelation matrix for the length n data vector x.
The scipy function gives the Toeplitz matrix, although I'm not sure if the implementations are identical.

- 66,734
- 27
- 141
- 140
-
Ye I'm not sure about that too and I don't really know the theory behind those – Rodrigo Forti Jul 20 '11 at 18:41
Here is a list of alternatives that can help you in translating your code, all of which contain that function:
scipy (toeplitz | corrmtx)
spectrum (corrmtx)
The following is a link to another post that tells you how to use numpy for the auto correlation since it seems to be the default funcationality of corrmtx
Additional Information:
Finding the correlation matrix in Python
Unbiased Estimation of Covariance Matrix