reorganize test folder: tests generation with MATLAB almost OK (but suboptimal method)
[valse.git] / src / test / generate_test_data / MATLAB_test_helpers / covariance.m
diff --git a/src/test/generate_test_data/MATLAB_test_helpers/covariance.m b/src/test/generate_test_data/MATLAB_test_helpers/covariance.m
new file mode 100644 (file)
index 0000000..839c33c
--- /dev/null
@@ -0,0 +1,9 @@
+%covariance matrix for tests on synthetic data: A(i,j) = a^|i-j|
+function[A] = covariance(p,a)
+
+       A = a*ones(p,p);
+       for i=1:p
+               A(i,:) = A(i,:) .^ abs(i-(1:p));
+       end
+
+end