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

import static org.junit.Assert.*;

import org.apache.jasper.tagplugins.jstl.ForEach;
import org.junit.Test;

public class TestAutokovarianz {

	@Test
	public void testBerechneAutokovarianz() throws Exception {
		
		int n = 4;
		double [] testZeitreihe = new double[n];
		testZeitreihe[0] = 0;
		testZeitreihe[1] = 1;
		testZeitreihe[2] = 2;
		testZeitreihe[3] = 3;
		
		for (int i =0; i<testZeitreihe.length; i++) {
			System.out.println("Zeitreihe["+i+"]: " + testZeitreihe);
		}
				
		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));
		
	}

}

@@ -94,59 +94,8 @@
 %0D%0A%0D%0A
-import org.apache.jasper.tagplugins.jstl.ForEach;%0D%0A
 impo
@@ -223,24 +223,26 @@
 on %7B%0D%0A%09%09%0D%0A%09%09
+//
 int n = 4;%0D%0A
@@ -273,121 +273,17 @@
 e = 
-new double%5Bn%5D;%0D%0A%09%09testZeitreihe%5B0%5D = 0;%0D%0A%09%09testZeitreihe%5B1%5D = 1;%0D%0A%09%09testZeitreihe%5B2%5D = 2;%0D%0A%09%09testZeitreihe%5B3%5D = 3
+%7B0,1,2,3%7D
 ;%0D%0A%09
@@ -392,16 +392,19 @@
 eitreihe
+%5Bi%5D
 );%0D%0A%09%09%7D%0D

change Test