在Python中corrmtx(在MATLAB中)对应的函数是什么?

2024-10-02 20:36:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在将一些代码从MATLAB翻译成Python,但我仍然坚持使用corrmtx()MATLAB函数。Python中是否有类似的函数,或者我如何替换它?在


Tags: 函数代码matlabcorrmtx
3条回答

spectrum包有这样一个function。在

怎么样:

http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.toeplitz.html

matlab文档用于corrmtx状态:

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.

scipy函数给出Toeplitz矩阵,尽管我不确定实现是否相同。在

下面是一个可以帮助您翻译代码的备选方案列表,它们都包含该功能:
scipytoeplitz| corrmtx
spectrumcorrmtx

下面是另一个post的链接,它告诉您如何使用numpy进行自相关,因为它似乎是corrmtx的默认函数

附加信息:
Finding the correlation matrix in Python
Unbiased Estimation of Covariance Matrix

相关问题 更多 >