Adding dep files and dependencies.

This commit is contained in:
Renan DelValle 2018-09-30 18:02:42 -07:00
parent 45f9efa578
commit b341c0a0e4
No known key found for this signature in database
GPG key ID: 3895800E03F17676
539 changed files with 313111 additions and 0 deletions

33
vendor/github.com/montanaflynn/stats/correlation.go generated vendored Normal file
View file

@ -0,0 +1,33 @@
package stats
import "math"
// Correlation describes the degree of relationship between two sets of data
func Correlation(data1, data2 Float64Data) (float64, error) {
l1 := data1.Len()
l2 := data2.Len()
if l1 == 0 || l2 == 0 {
return math.NaN(), EmptyInput
}
if l1 != l2 {
return math.NaN(), SizeErr
}
sdev1, _ := StandardDeviationPopulation(data1)
sdev2, _ := StandardDeviationPopulation(data2)
if sdev1 == 0 || sdev2 == 0 {
return 0, nil
}
covp, _ := CovariancePopulation(data1, data2)
return covp / (sdev1 * sdev2), nil
}
// Pearson calculates the Pearson product-moment correlation coefficient between two variables.
func Pearson(data1, data2 Float64Data) (float64, error) {
return Correlation(data1, data2)
}