p2: add correlation func
This commit is contained in:
parent
9aaf015fac
commit
e6fcc5dfbc
@ -63,6 +63,7 @@ func run() error {
|
||||
log.Printf("mutual correlation U,Y: %v", mutCorrelationUY)
|
||||
log.Printf("mutual correlation Y,U: %v", mutCorrelationYU)
|
||||
log.Printf("covariance U,Y: %v", cov)
|
||||
log.Printf("correlation U,Y: %v", stats.Correlation(data[u], data[y]))
|
||||
|
||||
log.Printf("len(impulseFunc): %d", len(impulseFunc))
|
||||
log.Printf("impulseFunc: %v", impulseFunc)
|
||||
|
@ -95,6 +95,10 @@ func Covariance(f1, f2 []float64) float64 {
|
||||
return stat.Covariance(f1, f2, nil)
|
||||
}
|
||||
|
||||
func Correlation(f1, f2 []float64) float64 {
|
||||
return stat.Correlation(f1, f2, nil)
|
||||
}
|
||||
|
||||
func ImpulseFunction(ruu []float64, ruy []float64) ([]float64, error) {
|
||||
lruu := len(ruu)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user