mirror of
https://github.com/gonum/gonum.git
synced 2025-10-20 21:59:25 +08:00
improve citation comment
This commit is contained in:
8
stat.go
8
stat.go
@@ -157,7 +157,7 @@ func Correlation(x, y, weights []float64) float64 {
|
|||||||
xcompensation += xd
|
xcompensation += xd
|
||||||
ycompensation += yd
|
ycompensation += yd
|
||||||
}
|
}
|
||||||
// xcompensation and ycompensation are from the Chan paper
|
// xcompensation and ycompensation are from Chan, et. al.
|
||||||
// referenced in the MeanVariance function. They are analogous
|
// referenced in the MeanVariance function. They are analogous
|
||||||
// to the second term in (1.7) in that paper.
|
// to the second term in (1.7) in that paper.
|
||||||
sxx -= xcompensation * xcompensation / float64(len(x))
|
sxx -= xcompensation * xcompensation / float64(len(x))
|
||||||
@@ -184,7 +184,7 @@ func Correlation(x, y, weights []float64) float64 {
|
|||||||
ycompensation += wyd
|
ycompensation += wyd
|
||||||
sumWeights += w
|
sumWeights += w
|
||||||
}
|
}
|
||||||
// xcompensation and ycompensation are from the Chan paper
|
// xcompensation and ycompensation are from Chan, et. al.
|
||||||
// referenced in the MeanVariance function. They are analogous
|
// referenced in the MeanVariance function. They are analogous
|
||||||
// to the second term in (1.7) in that paper, except they use
|
// to the second term in (1.7) in that paper, except they use
|
||||||
// the sumWeights instead of the sample count.
|
// the sumWeights instead of the sample count.
|
||||||
@@ -224,7 +224,7 @@ func Covariance(x, y, weights []float64) float64 {
|
|||||||
xcompensation += xd
|
xcompensation += xd
|
||||||
ycompensation += yd
|
ycompensation += yd
|
||||||
}
|
}
|
||||||
// xcompensation and ycompensation are from the Chan paper
|
// xcompensation and ycompensation are from Chan, et. al.
|
||||||
// referenced in the MeanVariance function. They are analogous
|
// referenced in the MeanVariance function. They are analogous
|
||||||
// to the second term in (1.7) in that paper.
|
// to the second term in (1.7) in that paper.
|
||||||
return (ss - xcompensation*ycompensation/float64(len(x))) / float64(len(x)-1)
|
return (ss - xcompensation*ycompensation/float64(len(x))) / float64(len(x)-1)
|
||||||
@@ -242,7 +242,7 @@ func Covariance(x, y, weights []float64) float64 {
|
|||||||
ycompensation += wyd
|
ycompensation += wyd
|
||||||
sumWeights += w
|
sumWeights += w
|
||||||
}
|
}
|
||||||
// xcompensation and ycompensation are from the Chan paper
|
// xcompensation and ycompensation are from Chan, et. al.
|
||||||
// referenced in the MeanVariance function. They are analogous
|
// referenced in the MeanVariance function. They are analogous
|
||||||
// to the second term in (1.7) in that paper, except they use
|
// to the second term in (1.7) in that paper, except they use
|
||||||
// the sumWeights instead of the sample count.
|
// the sumWeights instead of the sample count.
|
||||||
|
Reference in New Issue
Block a user