From 4bf633dc5b7a8011b13ce9e48e1b715d7274b7ba Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 25 Feb 2023 13:23:47 +0100 Subject: [PATCH] calculate autocorrelation for u,y --- p2/run.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/p2/run.go b/p2/run.go index 75b3a45..e187d32 100644 --- a/p2/run.go +++ b/p2/run.go @@ -34,11 +34,19 @@ func run() error { varianceU := stats.Variance(data[u]) varianceY := stats.Variance(data[y]) - log.Printf("len(data): %d\n", len(data[u])) + maxShift := 0.1 + autocorrelationU := stats.AutocorrelateMP(data[u], maxShift) + autocorrelationY := stats.AutocorrelateMP(data[y], maxShift) + + log.Printf("len(data): %d", len(data[u])) log.Printf("means - u: %v, y: %v", meanU, meanY) log.Printf("variance - u: %v, y: %v", varianceU, varianceY) + + log.Printf("len(autocorrelationU): %d", len(autocorrelationU)) + log.Printf("autocorrelationU: %v", autocorrelationU) + log.Printf("autocorrelationY: %v", autocorrelationY) } return nil