1

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?

Jonas Heidelberg
  • 4,984
  • 1
  • 27
  • 41
Rodrigo Forti
  • 256
  • 4
  • 14
  • 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 Answers3

2

The spectrum package has such a function.

schlamar
  • 9,238
  • 3
  • 38
  • 76
1

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.

JoshAdel
  • 66,734
  • 27
  • 141
  • 140
0

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

Community
  • 1
  • 1
dkroy
  • 2,020
  • 2
  • 21
  • 39