英文:
Can lmfit output the correlation matrix as an array?
问题
能否使用lmfit将完整的相关矩阵输出为一个NumPy数组?我知道result.covar
会将协方差矩阵输出为一个数组,并且可以使用result.fit_report(show_correl=True, min_correl=0)
来显示所有参数之间的相关系数。但我找不到一种获取相关矩阵的轻松格式化数组的方法。
英文:
Can lmfit output a complete correlation matrix as a numpy array?
I know result.covar
will output the covariance matrix as an array, and correlation coefficients between all the parameters can be shown with result.fit_report(show_correl=True, min_correl=0)
.
But I cannot find a way to get an easily formatted array of the correlation matrix.
答案1
得分: 0
result.covar
是一个numpy数组,你可以按照你的喜好进行格式化。
如果你使用了较新版本的lmfit
,你可以尝试:
result.fit_report(correl_mode='table')
来打印出一个相关性表格。有几个文档中的示例使用了这种方法。
英文:
Well, result.covar
is a numpy array, you could format that as you like.
If you have a recent version of lmfit
, you can try:
result.fit_report(correl_mode='table')
to print out a correlation table. Several of the documented examples use this.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论