floats: document LSM

This commit is contained in:
c9s 2023-05-29 17:55:57 +08:00
parent e91142f4e9
commit f067c92733
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -192,6 +192,7 @@ func (s Slice) LSM() float64 {
return LSM(s)
}
// LSM is the least squares method for linear regression
func LSM(values Slice) float64 {
var sumX, sumY, sumXSqr, sumXY = .0, .0, .0, .0