【问题标题】:Create covariance matrix using ratio and rotation degree使用比率和旋转度创建协方差矩阵
【发布时间】:2021-01-01 02:59:22
【问题描述】:

我是线性代数的初学者。我想使用给定的比率和旋转度创建一个协方差矩阵

例如: 如果比率为 2 且旋转度数为 45,则协方差矩阵应为:

[[2.5, 1.5], [1.5, 2.5]]

我试过了:

R = np.mat([[np.cos(0.785398), -np.sin(0.785398)], [np.sin(0.785398), np.cos(0.785398)]])
S = np.mat([[2, 0], [0, 2]])
np.cov(S@R.T)

我无法得到想要的结果。

【问题讨论】:

  • 不确定您要做什么...您要计算协方差的数据在哪里?是否要旋转和缩放结果?

标签: python numpy matrix linear-algebra


【解决方案1】:

如果你想像Burrito 所说的那样旋转和缩放数据,那么这个博客会有所帮助。它解释了您想要与代码一起执行的所有操作。 covariance-matrix

【讨论】:

  • 为了解决用户的问题,请避免发布未包含相关代码的链接。
猜你喜欢
  • 2019-03-26
  • 1970-01-01
  • 2015-01-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-02-12
  • 2019-04-15
相关资源
最近更新 更多