package dhbw.ka.mwi.businesshorizon2.methods.timeseries;

import static org.junit.Assert.*;

import org.junit.Test;

public class TestAutokovarianz {

	@Test
	public void testBerechneAutokovarianz() throws Exception {
		
		//int n = 4;
		double [] testZeitreihe = {0,1,2,3};
		
		for (int i =0; i<testZeitreihe.length; i++) {
			System.out.println("Zeitreihe["+i+"]: " + testZeitreihe[i]);
		}
				
		int i_TestLag = 1;
		System.out.println("Lag: " + i_TestLag);
		
		//double db_TestAutocovariance = 0;
		//System.out.println("Autovarianz: " + db_TestAutocovariance);
		
		AnalysisTimeseries atTest = new AnalysisTimeseries();		
		System.out.println("Autokovarianz: " + atTest.calculateAutocovariance(testZeitreihe, i_TestLag));
		
	}

}

@@ -247,43 +247,154 @@
 %0D%0A%09%09
-double %5B%5D testZeitreihe = %7B0,1,2,3%7D
+AnalysisTimeseries at = new AnalysisTimeseries();%0D%0A%09%09double %5B%5D testZeitreihe = %7B8,12,10,14,12,16%7D;%0D%0A%09%09testZeitreihe = at.reduceTide(testZeitreihe)
 ;%0D%0A%09
@@ -539,17 +539,17 @@
 stLag = 
-1
+0
 ;%0D%0A%09%09Sys
@@ -756,19 +756,85 @@
 ries();%09
-%09
 %0D%0A
+%09%09for(int i = 0; i%3CtestZeitreihe.length;i++)%7B%0D%0A%09%09%09i_TestLag = i;%0D%0A%09
 %09%09System
@@ -856,24 +856,47 @@
 utokovarianz
+ mit Lag %22+ i_TestLag+%22
 : %22 + atTest
@@ -951,16 +951,151 @@
 g));%0D%0A%09%09
+%09System.out.println(%22Autokorrelation mit Lag %22+ i_TestLag+%22: %22 + atTest.calculateAutocorrelation(testZeitreihe, i_TestLag));%0D%0A%09%09%7D%0D%0A%09%09%09%09
 %0D%0A%09%7D%0D%0A%0D%0A

change test