lmfit能够将相关矩阵输出为一个数组吗?

huangapple go评论85阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月21日 22:43:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76300452.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定