c++ - 通过确定系数找到两个 vector 的关系

标签 c++ algorithm vector statistics correlation

我有一个关于决定系数的问题。

我需要找出两个 vector 之间的关系。

给定两个数值 vector x和y,它们的系数确定可以表示为:

1 - ( 1 -  (dot_product(x,y))^2 / (|x|^2 + |y|^2)) / (1 - |y| * |y|/ ( y'dimension * |y|^2 ) ) 

|x|^2 = sum of squared of each element of vector x.
|y|  =  sum of each element of vector y.

对吗?

我从一些代码中得到了公式,但我不认识作者。

如何理解?

如有任何帮助,我们将不胜感激!

最佳答案

来自 wiki: Coefficient of determination .

In statistics, the coefficient of determination, denoted R2 and pronounced R squared, indicates how well data points fit a statistical model – sometimes simply a line or curve. It is a statistic used in the context of statistical models whose main purpose is either the prediction of future outcomes or the testing of hypotheses, on the basis of other related information. It provides a measure of how well observed outcomes are replicated by the model, as the proportion of total variation of outcomes explained by the model.[1 The correlation coefficient, r, and the coefficient of determination, r^2.

计算r的数学公式为:

enter image description here

其中 n 是数据对的数量。


引用资料:

  1. wiki: Coefficient of determination .
  2. Correlation Coefficient .

关于c++ - 通过确定系数找到两个 vector 的关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22214727/

相关文章:

c++ - 我真的应该将头文件指定为 target_sources() 吗?

c++ - 如何在 QGraphicsView/Scene 上绘制 QPoint

arrays - 如何更有效地将词汇存储在数组中?

java - 深度优先/广度优先算法打印所有节点;我如何让它只打印路径中的节点?

android - 无法导入创建的矢量可绘制对象

c++ - 将自定义类对象作为值传递到 STL 映射中

c++ - 用另一个const std::vector和其他值创建一个const std::vector

c++ - 基类构造函数 protected 时在派生类成员函数中创建基类实例

c++ - 引用临时成员

c# - 算法比较 C#