Index: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Evaluators/OnlineMeanMahalanobisDistanceEvaluator.cs
===================================================================
--- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Evaluators/OnlineMeanMahalanobisDistanceEvaluator.cs	(revision 4475)
+++ branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Evaluators/OnlineMeanMahalanobisDistanceEvaluator.cs	(revision 4475)
@@ -0,0 +1,92 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Evaluators {
+  public class OnlineMeanMahalanobisDistanceEvaluator : IMultiVariateOnlineEvaluator {
+    private int n;
+    private double distance;
+    private double[,] covMatrix;
+    public double MeanMahalanobisDistance {
+      get {
+        if (n == 0) throw new InvalidOperationException("no elements");
+        else
+          return Math.Sqrt(distance) / n;
+      }
+    }
+
+    public double MeanGeneralizedSquaredInterpointDistance {
+      get {
+        if (n == 0) throw new InvalidOperationException("no elements");
+        else
+          return distance / n;
+      }
+    }
+
+    public OnlineMeanMahalanobisDistanceEvaluator() {
+      Reset();
+    }
+
+    #region IMultiVariateOnlineEvaluator Members
+    public double Value {
+      get { return MeanMahalanobisDistance; }
+    }
+
+    public void Add(double[] original, double[] estimated) {
+      if (original.Length != estimated.Length) throw new ArgumentException("Number of elements of original and estimated doesn't match.");
+      if (original.Length != covMatrix.GetLength(0)) throw new ArgumentException("Original and estimated is not compatible with covariance matrix.");
+
+      double[] diff = new double[original.Length];
+      for (int i = 0; i < diff.Length; i++) {
+        diff[i] = original[i] - estimated[i];
+      }
+      double[] target = new double[original.Length];
+
+      alglib.ablas.rmatrixmv(covMatrix.GetLength(0), covMatrix.GetLength(1), ref covMatrix, 0, 0, 0, ref diff, 0, ref target, 0);
+
+      double sum = 0.0;
+      for (int i = 0; i < original.Length; i++) {
+        sum += diff[i] * target[i];
+      }
+      distance += sum;
+      n++;
+    }
+
+    public void Reset() {
+      n = 0;
+      distance = 0.0;
+    }
+
+    #endregion
+
+    public void InitializeCovarianceMatrixFromSamples(params IEnumerable<double>[] samples) {
+      covMatrix = new double[samples.Length, samples.Length];
+      OnlineCovarianceEvaluator covEvaluator = new OnlineCovarianceEvaluator();
+      for (int i = 0; i < samples.Length; i++) {
+        for (int j = i; j < samples.Length; j++) {
+          var xEnumerator = samples[i].GetEnumerator();
+          var yEnumerator = samples[j].GetEnumerator();
+          covEvaluator.Reset();
+          while (xEnumerator.MoveNext() & yEnumerator.MoveNext()) {
+            covEvaluator.Add(xEnumerator.Current, yEnumerator.Current);
+          }
+          if (xEnumerator.MoveNext() | yEnumerator.MoveNext()) {
+            throw new ArgumentException("Number of elements must be the same in all enumerations.");
+          }
+          covMatrix[i, j] = covEvaluator.Covariance;
+          covMatrix[j, i] = covEvaluator.Covariance;
+        }
+      }
+      int info = 0;
+      alglib.matinv.matinvreport report = new alglib.matinv.matinvreport();
+      alglib.matinv.rmatrixinverse(ref covMatrix, covMatrix.GetLength(0), ref info, ref report);
+      if (info != 1) throw new InvalidOperationException("Can't invert covariance matrix.");
+    }
+  }
+}
Index: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Evaluators/OnlineMultiVariateEvaluator.cs
===================================================================
--- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Evaluators/OnlineMultiVariateEvaluator.cs	(revision 4475)
+++ branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Evaluators/OnlineMultiVariateEvaluator.cs	(revision 4475)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Evaluators {
+  public class OnlineMultiVariateEvaluator<T> : IMultiVariateOnlineEvaluator where T : IOnlineEvaluator, new() {
+    private List<T> evaluators;
+
+    public OnlineMultiVariateEvaluator() {
+
+      Reset();
+    }
+
+    #region IMultiVariateOnlineEvaluator Members
+    public double Value {
+      get { return evaluators.Sum(e => e.Value); }
+    }
+
+    public void Add(double[] original, double[] estimated) {
+      if (original.Length != estimated.Length) throw new ArgumentException("Number of elements of original and estimated doesn't match.");
+      if (evaluators == null) InitializeEvaluators(original.Length);
+      if (original.Length != evaluators.Count) throw new ArgumentException("Dimension doesn't match previous array dimensions.");
+      for (int i = 0; i < original.Length; i++) {
+        evaluators[i].Add(original[i], estimated[i]);
+      }
+    }
+
+    private void InitializeEvaluators(int count) {
+      evaluators = new List<T>();
+      for (int i = 0; i < count; i++) {
+        evaluators.Add(new T());
+      }
+    }
+
+    public void Reset() {
+      if (evaluators != null) {
+        foreach (var evaluator in evaluators)
+          evaluator.Reset();
+      }
+    }
+
+    #endregion
+  }
+}
Index: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/HeuristicLab.Problems.DataAnalysis.MultiVariate-3.3.csproj
===================================================================
--- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/HeuristicLab.Problems.DataAnalysis.MultiVariate-3.3.csproj	(revision 4461)
+++ branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/HeuristicLab.Problems.DataAnalysis.MultiVariate-3.3.csproj	(revision 4475)
@@ -109,5 +109,8 @@
     <None Include="HeuristicLabProblemsDataAnalysisMultiVariatePlugin.cs.frame" />
     <None Include="Properties\AssemblyInfo.frame" />
+    <Compile Include="Evaluators\OnlineMultiVariateEvaluator.cs" />
+    <Compile Include="Evaluators\OnlineMeanMahalanobisDistanceEvaluator.cs" />
     <Compile Include="HeuristicLabProblemsDataAnalysisMultiVariatePlugin.cs" />
+    <Compile Include="Interfaces\IMultiVariateOnlineEvaluator.cs" />
     <Compile Include="Interfaces\IMultiVariateDataAnalysisEvaluator.cs" />
     <Compile Include="Interfaces\IMultiVariateDataAnalysisModel.cs" />
@@ -143,4 +146,12 @@
       <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\2.5.0\ALGLIB-2.5.0\ALGLIB-2.5.0.csproj">
+      <Project>{29E4B033-1FEF-4FE1-AE17-0A9319D7C54E}</Project>
+      <Name>ALGLIB-2.5.0</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\2.5.0\HeuristicLab.ALGLIB-2.5.0\HeuristicLab.ALGLIB-2.5.0.csproj">
+      <Project>{01BBCB5A-144A-4A7E-908E-079849E2F7CF}</Project>
+      <Name>HeuristicLab.ALGLIB-2.5.0 %28HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\HeuristicLab.ALGLIB-2.5.0\HeuristicLab.ALGLIB-2.5.0%29</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
Index: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Interfaces/IMultiVariateOnlineEvaluator.cs
===================================================================
--- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Interfaces/IMultiVariateOnlineEvaluator.cs	(revision 4475)
+++ branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/Interfaces/IMultiVariateOnlineEvaluator.cs	(revision 4475)
@@ -0,0 +1,31 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.DataAnalysis.MultiVariate {
+  public interface IMultiVariateOnlineEvaluator {
+    double Value { get; }
+    void Reset();
+    void Add(double[] original, double[] estimated);
+  }
+}
