Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceConst.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceConst.cs	(revision 8928)
+++ 	(revision )
@@ -1,105 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceConst",
-    Description = "Constant covariance function for Gaussian processes.")]
-  public sealed class CovarianceConst : ParameterizedNamedItem, ICovarianceFunction {
-
-    [Storable]
-    private double scale;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter {
-      get { return scaleParameter; }
-    }
-
-    [StorableConstructor]
-    private CovarianceConst(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceConst(CovarianceConst original, Cloner cloner)
-      : base(original, cloner) {
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-      this.scale = original.scale;
-
-      RegisterEvents();
-    }
-
-    public CovarianceConst()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of the constant covariance function.");
-      Parameters.Add(scaleParameter);
-      RegisterEvents();
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    // caching
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { scale = scaleParameter.Value.Value; });
-    }
-
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceConst(this, cloner);
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return scaleParameter.Fixed ? 0 : 1;
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (!scaleParameter.Fixed && hyp.Length == 1) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[0])));
-      } else {
-        throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceConst", "hyp");
-      }
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return scale;
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      yield return 2.0 * scale;
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return scale;
-    }
-  }
-}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs	(revision 8929)
@@ -0,0 +1,105 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceConst",
+    Description = "Constant covariance function for Gaussian processes.")]
+  public sealed class CovarianceConst : ParameterizedNamedItem, ICovarianceFunction {
+
+    [Storable]
+    private double scale;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter {
+      get { return scaleParameter; }
+    }
+
+    [StorableConstructor]
+    private CovarianceConst(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceConst(CovarianceConst original, Cloner cloner)
+      : base(original, cloner) {
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+      this.scale = original.scale;
+
+      RegisterEvents();
+    }
+
+    public CovarianceConst()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of the constant covariance function.");
+      Parameters.Add(scaleParameter);
+      RegisterEvents();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    // caching
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { scale = scaleParameter.Value.Value; });
+    }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceConst(this, cloner);
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return scaleParameter.Fixed ? 0 : 1;
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (!scaleParameter.Fixed && hyp.Length == 1) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[0])));
+      } else {
+        throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceConst", "hyp");
+      }
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return scale;
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      yield return 2.0 * scale;
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return scale;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinear.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinear.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinear.cs	(revision 8929)
@@ -0,0 +1,65 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceLinear", Description = "Linear covariance function for Gaussian processes.")]
+  public sealed class CovarianceLinear : Item, ICovarianceFunction {
+    [StorableConstructor]
+    private CovarianceLinear(bool deserializing) : base(deserializing) { }
+    private CovarianceLinear(CovarianceLinear original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public CovarianceLinear()
+      : base() {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceLinear(this, cloner);
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return 0;
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (hyp.Length > 0) throw new ArgumentException("No hyperparameters are allowed for the linear covariance function.");
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return Util.ScalarProd(x, i, j, 1, columnIndices);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      yield break;
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return Util.ScalarProd(x, i, xt, j);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinearArd.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinearArd.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinearArd.cs	(revision 8929)
@@ -0,0 +1,110 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceLinearArd",
+    Description = "Linear covariance function with automatic relevance determination for Gaussian processes.")]
+  public sealed class CovarianceLinearArd : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private double[] inverseLength;
+    [Storable]
+    private readonly HyperParameter<DoubleArray> inverseLengthParameter;
+    public IValueParameter<DoubleArray> InverseLengthParameter {
+      get { return inverseLengthParameter; }
+    }
+
+    [StorableConstructor]
+    private CovarianceLinearArd(bool deserializing) : base(deserializing) { }
+    private CovarianceLinearArd(CovarianceLinearArd original, Cloner cloner)
+      : base(original, cloner) {
+      inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
+      if (original.inverseLength != null) {
+        this.inverseLength = new double[original.inverseLength.Length];
+        Array.Copy(original.inverseLength, inverseLength, inverseLength.Length);
+      }
+
+      RegisterEvents();
+    }
+    public CovarianceLinearArd()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      inverseLengthParameter = new HyperParameter<DoubleArray>("InverseLength",
+                                                               "The inverse length parameter for ARD.");
+      Parameters.Add(inverseLengthParameter);
+      RegisterEvents();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceLinearArd(this, cloner);
+    }
+
+    // caching
+    private void RegisterEvents() {
+      Util.AttachArrayChangeHandler<DoubleArray, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.ToArray(); });
+    }
+
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      if (!inverseLengthParameter.Fixed)
+        return numberOfVariables;
+      else
+        return 0;
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (!inverseLengthParameter.Fixed && hyp.Length > 0) {
+        inverseLengthParameter.SetValue(new DoubleArray(hyp.Select(e => 1.0 / Math.Exp(e)).ToArray()));
+      } else throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceLinearArd", "hyp");
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return Util.ScalarProd(x, i, j, inverseLength, columnIndices);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
+
+      foreach (int k in columnIndices) {
+        yield return -2.0 * x[i, k] * x[j, k] * inverseLength[k] * inverseLength[k];
+      }
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return Util.ScalarProd(x, i, xt, j, inverseLength, columnIndices);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMask.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMask.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMask.cs	(revision 8929)
@@ -0,0 +1,124 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceMask",
+    Description = "Masking covariance function for dimension selection can be used to apply a covariance function only on certain input dimensions.")]
+  public sealed class CovarianceMask : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private int[] selectedDimensions;
+    [Storable]
+    private readonly ValueParameter<IntArray> selectedDimensionsParameter;
+    public IValueParameter<IntArray> SelectedDimensionsParameter {
+      get { return selectedDimensionsParameter; }
+    }
+
+    [Storable]
+    private ICovarianceFunction cov;
+    [Storable]
+    private readonly ValueParameter<ICovarianceFunction> covParameter;
+    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
+      get { return covParameter; }
+    }
+
+    [StorableConstructor]
+    private CovarianceMask(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceMask(CovarianceMask original, Cloner cloner)
+      : base(original, cloner) {
+      this.selectedDimensionsParameter = cloner.Clone(original.selectedDimensionsParameter);
+      if (original.selectedDimensions != null) {
+        this.selectedDimensions = (int[])original.selectedDimensions.Clone();
+      }
+
+      this.covParameter = cloner.Clone(original.covParameter);
+      this.cov = cloner.Clone(original.cov);
+      RegisterEvents();
+    }
+
+    public CovarianceMask()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.selectedDimensionsParameter = new ValueParameter<IntArray>("SelectedDimensions", "The dimensions on which the specified covariance function should be applied to.");
+      this.covParameter = new ValueParameter<ICovarianceFunction>("CovarianceFunction", "The covariance function that should be scaled.", new CovarianceSquaredExponentialIso());
+      cov = covParameter.Value;
+
+      Parameters.Add(selectedDimensionsParameter);
+      Parameters.Add(covParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceMask(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachArrayChangeHandler<IntArray, int>(selectedDimensionsParameter, () => {
+        selectedDimensions = selectedDimensionsParameter.Value
+          .OrderBy(x => x)
+          .Distinct()
+          .ToArray();
+        if (selectedDimensions.Length == 0) selectedDimensions = null;
+      });
+      covParameter.ValueChanged += (sender, args) => { cov = covParameter.Value; };
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      if (selectedDimensions == null) return cov.GetNumberOfParameters(numberOfVariables);
+      else return cov.GetNumberOfParameters(selectedDimensions.Length);
+    }
+
+    public void SetParameter(double[] hyp) {
+      cov.SetParameter(hyp);
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return cov.GetCovariance(x, i, j, selectedDimensions);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return cov.GetGradient(x, i, j, selectedDimensions);
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return cov.GetCrossCovariance(x, xt, i, j, selectedDimensions);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMaternIso.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMaternIso.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMaternIso.cs	(revision 8929)
@@ -0,0 +1,177 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceMaternIso",
+    Description = "Matern covariance function for Gaussian processes.")]
+  public sealed class CovarianceMaternIso : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private double inverseLength;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
+    public IValueParameter<DoubleValue> InverseLengthParameter {
+      get { return inverseLengthParameter; }
+    }
+
+    [Storable]
+    private double sf2;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter {
+      get { return scaleParameter; }
+    }
+
+    [Storable]
+    private int d;
+    [Storable]
+    private readonly ConstrainedValueParameter<IntValue> dParameter;
+    public IConstrainedValueParameter<IntValue> DParameter {
+      get { return dParameter; }
+    }
+
+
+    [StorableConstructor]
+    private CovarianceMaternIso(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceMaternIso(CovarianceMaternIso original, Cloner cloner)
+      : base(original, cloner) {
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+      this.sf2 = original.sf2;
+      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
+      this.inverseLength = original.inverseLength;
+      this.dParameter = cloner.Clone(original.dParameter);
+      this.d = original.d;
+      RegisterEvents();
+    }
+
+    public CovarianceMaternIso()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric Matern covariance function.");
+      scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the isometric Matern covariance function.");
+      var validDValues = new ItemSet<IntValue>();
+      validDValues.Add((IntValue)new IntValue(1).AsReadOnly());
+      validDValues.Add((IntValue)new IntValue(3).AsReadOnly());
+      validDValues.Add((IntValue)new IntValue(5).AsReadOnly());
+      dParameter = new ConstrainedValueParameter<IntValue>("D", "The d parameter (allowed values: 1, 3, or 5) of the isometric Matern covariance function.", validDValues, validDValues.First());
+      d = dParameter.Value.Value;
+
+      Parameters.Add(inverseLengthParameter);
+      Parameters.Add(scaleParameter);
+      Parameters.Add(dParameter);
+
+      RegisterEvents();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceMaternIso(this, cloner);
+    }
+
+    // caching
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
+      Util.AttachValueChangeHandler<IntValue, int>(dParameter, () => { d = dParameter.Value.Value; });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return
+        (inverseLengthParameter.Fixed ? 0 : 1) +
+        (scaleParameter.Fixed ? 0 : 1);
+    }
+
+    public void SetParameter(double[] hyp) {
+      int i = 0;
+      if (!inverseLengthParameter.Fixed) {
+        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
+        i++;
+      }
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
+        i++;
+      }
+      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceMaternIso", "hyp");
+    }
+
+
+    private double m(double t) {
+      double f;
+      switch (d) {
+        case 1: { f = 1; break; }
+        case 3: { f = 1 + t; break; }
+        case 5: { f = 1 + t * (1 + t / 3.0); break; }
+        default: throw new InvalidOperationException();
+      }
+      return f * Math.Exp(-t);
+    }
+
+    private double dm(double t) {
+      double df;
+      switch (d) {
+        case 1: { df = 1; break; }
+        case 3: { df = t; break; }
+        case 5: { df = t * (1 + t) / 3.0; break; }
+        default: throw new InvalidOperationException();
+      }
+      return df * t * Math.Exp(-t);
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double dist = i == j
+                   ? 0.0
+                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength, columnIndices));
+      return sf2 * m(dist);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double dist = i == j
+                   ? 0.0
+                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength, columnIndices));
+
+      yield return sf2 * dm(dist);
+      yield return 2 * sf2 * m(dist);
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double dist = Math.Sqrt(Util.SqrDist(x, i, xt, j, Math.Sqrt(d) * inverseLength, columnIndices));
+      return sf2 * m(dist);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceNoise.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceNoise.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceNoise.cs	(revision 8929)
@@ -0,0 +1,104 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceNoise",
+    Description = "Noise covariance function for Gaussian processes.")]
+  public sealed class CovarianceNoise : ParameterizedNamedItem, ICovarianceFunction {
+
+
+    [Storable]
+    private double sf2;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter {
+      get { return scaleParameter; }
+    }
+
+    [StorableConstructor]
+    private CovarianceNoise(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceNoise(CovarianceNoise original, Cloner cloner)
+      : base(original, cloner) {
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+      this.sf2 = original.sf2;
+      RegisterEvents();
+    }
+
+    public CovarianceNoise()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of noise.");
+      Parameters.Add(this.scaleParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceNoise(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return scaleParameter.Fixed ? 0 : 1;
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[0])));
+      } else {
+        if (hyp.Length > 0) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceNoise", "hyp");
+      }
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return i == j ? sf2 : 0.0;
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      yield return i == j ? 2 * sf2 : 0.0;
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return 0.0;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePeriodic.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePeriodic.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePeriodic.cs	(revision 8929)
@@ -0,0 +1,159 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovariancePeriodic", Description = "Periodic covariance function for Gaussian processes.")]
+  public sealed class CovariancePeriodic : ParameterizedNamedItem, ICovarianceFunction {
+
+    [Storable]
+    private double scale;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter {
+      get { return scaleParameter; }
+    }
+
+    [Storable]
+    private double inverseLength;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
+    public IValueParameter<DoubleValue> InverseLengthParameter {
+      get { return inverseLengthParameter; }
+    }
+
+    [Storable]
+    private double period;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> periodParameter;
+    public IValueParameter<DoubleValue> PeriodParameter {
+      get { return periodParameter; }
+    }
+
+
+    [StorableConstructor]
+    private CovariancePeriodic(bool deserializing) : base(deserializing) { }
+    private CovariancePeriodic(CovariancePeriodic original, Cloner cloner)
+      : base(original, cloner) {
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
+      this.periodParameter = cloner.Clone(original.periodParameter);
+      this.scale = original.scale;
+      this.inverseLength = original.inverseLength;
+      this.period = original.period;
+
+      RegisterEvents();
+    }
+
+    public CovariancePeriodic()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of the periodic covariance function.");
+      inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter for the periodic covariance function.");
+      periodParameter = new HyperParameter<DoubleValue>("Period", "The period parameter for the periodic covariance function.");
+      Parameters.Add(scaleParameter);
+      Parameters.Add(inverseLengthParameter);
+      Parameters.Add(periodParameter);
+
+      RegisterEvents();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovariancePeriodic(this, cloner);
+    }
+
+    // caching
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { scale = scaleParameter.Value.Value; });
+      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
+      Util.AttachValueChangeHandler<DoubleValue, double>(periodParameter, () => { period = periodParameter.Value.Value; });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return
+        (new[] { scaleParameter, inverseLengthParameter, periodParameter }).Count(p => !p.Fixed);
+    }
+
+    public void SetParameter(double[] hyp) {
+      int i = 0;
+      if (!inverseLengthParameter.Fixed) {
+        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
+        i++;
+      }
+      if (!periodParameter.Fixed) {
+        periodParameter.SetValue(new DoubleValue(Math.Exp(hyp[i])));
+        i++;
+      }
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
+        i++;
+      }
+      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovariancePeriod", "hyp");
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double k = i == j ? 0.0 : GetDistance(x, x, i, j, columnIndices);
+      k = Math.PI * k / period;
+      k = Math.Sin(k) * inverseLength;
+      k = k * k;
+
+      return scale * Math.Exp(-2.0 * k);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices) / period;
+      double gradient = Math.Sin(v) * inverseLength;
+      gradient *= gradient;
+      yield return 4.0 * scale * Math.Exp(-2.0 * gradient) * gradient;
+      double r = Math.Sin(v) * inverseLength;
+      yield return 4.0 * scale * inverseLength * Math.Exp(-2 * r * r) * r * Math.Cos(v) * v;
+      yield return 2.0 * scale * Math.Exp(-2 * gradient);
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double k = GetDistance(x, xt, i, j, columnIndices);
+      k = Math.PI * k / period;
+      k = Math.Sin(k) * inverseLength;
+      k = k * k;
+
+      return scale * Math.Exp(-2.0 * k);
+    }
+
+    private double GetDistance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return Math.Sqrt(Util.SqrDist(x, i, xt, j, 1, columnIndices));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceProduct.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceProduct.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceProduct.cs	(revision 8929)
@@ -0,0 +1,98 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceProduct",
+    Description = "Product covariance function for Gaussian processes.")]
+  public sealed class CovarianceProduct : Item, ICovarianceFunction {
+    [Storable]
+    private ItemList<ICovarianceFunction> factors;
+
+    [Storable]
+    private int numberOfVariables;
+    public ItemList<ICovarianceFunction> Factors {
+      get { return factors; }
+    }
+
+    [StorableConstructor]
+    private CovarianceProduct(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceProduct(CovarianceProduct original, Cloner cloner)
+      : base(original, cloner) {
+      this.factors = cloner.Clone(original.factors);
+      this.numberOfVariables = original.numberOfVariables;
+    }
+
+    public CovarianceProduct()
+      : base() {
+      this.factors = new ItemList<ICovarianceFunction>();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceProduct(this, cloner);
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      this.numberOfVariables = numberOfVariables;
+      return factors.Select(f => f.GetNumberOfParameters(numberOfVariables)).Sum();
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (factors.Count == 0) throw new ArgumentException("at least one factor is necessary for the product covariance function.");
+      int offset = 0;
+      foreach (var t in factors) {
+        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
+        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
+        offset += numberOfParameters;
+      }
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).Aggregate((a, b) => a * b);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      var covariances = factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).ToArray();
+      for (int ii = 0; ii < factors.Count; ii++) {
+        foreach (var g in factors[ii].GetGradient(x, i, j, columnIndices)) {
+          double res = g;
+          for (int jj = 0; jj < covariances.Length; jj++)
+            if (ii != jj) res *= covariances[jj];
+          yield return res;
+        }
+      }
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return factors.Select(f => f.GetCrossCovariance(x, xt, i, j, columnIndices)).Aggregate((a, b) => a * b);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticArd.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticArd.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticArd.cs	(revision 8929)
@@ -0,0 +1,161 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceRationalQuadraticArd",
+    Description = "Rational quadratic covariance function with automatic relevance determination for Gaussian processes.")]
+  public sealed class CovarianceRationalQuadraticArd : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private double sf2;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter {
+      get { return scaleParameter; }
+    }
+
+    [Storable]
+    private double[] inverseLength;
+    [Storable]
+    private readonly HyperParameter<DoubleArray> inverseLengthParameter;
+    public IValueParameter<DoubleArray> InverseLengthParameter {
+      get { return inverseLengthParameter; }
+    }
+
+    [Storable]
+    private double shape;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> shapeParameter;
+    public IValueParameter<DoubleValue> ShapeParameter {
+      get { return shapeParameter; }
+    }
+
+    [StorableConstructor]
+    private CovarianceRationalQuadraticArd(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceRationalQuadraticArd(CovarianceRationalQuadraticArd original, Cloner cloner)
+      : base(original, cloner) {
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+      this.sf2 = original.sf2;
+
+      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
+      if (original.inverseLength != null) {
+        this.inverseLength = new double[original.inverseLength.Length];
+        Array.Copy(original.inverseLength, inverseLength, inverseLength.Length);
+      }
+
+      this.shapeParameter = cloner.Clone(original.shapeParameter);
+      this.shape = original.shape;
+
+      RegisterEvents();
+    }
+
+    public CovarianceRationalQuadraticArd()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the rational quadratic covariance function with ARD.");
+      this.inverseLengthParameter = new HyperParameter<DoubleArray>("InverseLength", "The inverse length parameter for automatic relevance determination.");
+      this.shapeParameter = new HyperParameter<DoubleValue>("Shape", "The shape parameter (alpha) of the rational quadratic covariance function with ARD.");
+
+      Parameters.Add(scaleParameter);
+      Parameters.Add(inverseLengthParameter);
+      Parameters.Add(shapeParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceRationalQuadraticArd(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
+      Util.AttachValueChangeHandler<DoubleValue, double>(shapeParameter, () => { shape = shapeParameter.Value.Value; });
+      Util.AttachArrayChangeHandler<DoubleArray, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.ToArray(); });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return
+        (scaleParameter.Fixed ? 0 : 1) +
+        (shapeParameter.Fixed ? 0 : 1) +
+        (inverseLengthParameter.Fixed ? 0 : numberOfVariables);
+    }
+
+    public void SetParameter(double[] hyp) {
+      int i = 0;
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
+        i++;
+      }
+      if (!shapeParameter.Fixed) {
+        shapeParameter.SetValue(new DoubleValue(Math.Exp(hyp[i])));
+        i++;
+      }
+      if (!inverseLengthParameter.Fixed) {
+        inverseLengthParameter.SetValue(new DoubleArray(hyp.Skip(i).Select(e => 1.0 / Math.Exp(e)).ToArray()));
+        i += hyp.Skip(i).Count();
+      }
+      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceRationalQuadraticArd", "hyp");
+    }
+
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+      double b = 1 + 0.5 * d / shape;
+      for (int k = 0; k < inverseLength.Length; k++) {
+        yield return sf2 * Math.Pow(b, -shape - 1) * Util.SqrDist(x[i, k] * inverseLength[k], x[j, k] * inverseLength[k]);
+      }
+      yield return 2 * sf2 * Math.Pow(b, -shape);
+      yield return sf2 * Math.Pow(b, -shape) * (0.5 * d / b - shape * Math.Log(b));
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
+      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticIso.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticIso.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticIso.cs	(revision 8929)
@@ -0,0 +1,150 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceRationalQuadraticIso",
+    Description = "Isotropic rational quadratic covariance function for Gaussian processes.")]
+  public sealed class CovarianceRationalQuadraticIso : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private double sf2;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter { get { return scaleParameter; } }
+
+    [Storable]
+    private double inverseLength;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
+    public IValueParameter<DoubleValue> InverseLengthParameter { get { return inverseLengthParameter; } }
+
+    [Storable]
+    private double shape;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> shapeParameter;
+    public IValueParameter<DoubleValue> ShapeParameter { get { return shapeParameter; } }
+
+    [StorableConstructor]
+    private CovarianceRationalQuadraticIso(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceRationalQuadraticIso(CovarianceRationalQuadraticIso original, Cloner cloner)
+      : base(original, cloner) {
+      this.sf2 = original.sf2;
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+
+      this.inverseLength = original.inverseLength;
+      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
+
+      this.shape = original.shape;
+      this.shapeParameter = cloner.Clone(original.shapeParameter);
+
+      RegisterEvents();
+    }
+
+    public CovarianceRationalQuadraticIso()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the isometric rational quadratic covariance function.");
+      this.inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric rational quadratic covariance function.");
+      this.shapeParameter = new HyperParameter<DoubleValue>("Shape", "The shape parameter (alpha) of the isometric rational quadratic covariance function.");
+
+      Parameters.Add(scaleParameter);
+      Parameters.Add(inverseLengthParameter);
+      Parameters.Add(shapeParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceRationalQuadraticIso(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
+      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
+      Util.AttachValueChangeHandler<DoubleValue, double>(shapeParameter, () => { shape = shapeParameter.Value.Value; });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return
+        (scaleParameter.Fixed ? 0 : 1) +
+        (inverseLengthParameter.Fixed ? 0 : 1) +
+        (shapeParameter.Fixed ? 0 : 1);
+    }
+
+    public void SetParameter(double[] hyp) {
+      int i = 0;
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
+        i++;
+      }
+      if (!shapeParameter.Fixed) {
+        shapeParameter.SetValue(new DoubleValue(Math.Exp(hyp[i])));
+        i++;
+      }
+      if (!inverseLengthParameter.Fixed) {
+        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
+        i++;
+      }
+      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceRationalQuadraticIso", "hyp");
+    }
+
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+
+      double b = 1 + 0.5 * d / shape;
+      yield return sf2 * Math.Pow(b, -shape - 1) * d;
+      yield return 2 * sf2 * Math.Pow(b, -shape);
+      yield return sf2 * Math.Pow(b, -shape) * (0.5 * d / b - shape * Math.Log(b));
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
+      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceScale.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceScale.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceScale.cs	(revision 8929)
@@ -0,0 +1,123 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceScale",
+    Description = "Scale covariance function for Gaussian processes.")]
+  public sealed class CovarianceScale : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private double sf2;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter {
+      get { return scaleParameter; }
+    }
+
+    [Storable]
+    private ICovarianceFunction cov;
+    [Storable]
+    private readonly ValueParameter<ICovarianceFunction> covParameter;
+    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
+      get { return covParameter; }
+    }
+
+    [StorableConstructor]
+    private CovarianceScale(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceScale(CovarianceScale original, Cloner cloner)
+      : base(original, cloner) {
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+      this.sf2 = original.sf2;
+
+      this.covParameter = cloner.Clone(original.covParameter);
+      this.cov = cloner.Clone(original.cov);
+      RegisterEvents();
+    }
+
+    public CovarianceScale()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter.");
+      this.covParameter = new ValueParameter<ICovarianceFunction>("CovarianceFunction", "The covariance function that should be scaled.", new CovarianceSquaredExponentialIso());
+      cov = covParameter.Value;
+
+      Parameters.Add(this.scaleParameter);
+      Parameters.Add(covParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceScale(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
+      covParameter.ValueChanged += (sender, args) => { cov = covParameter.Value; };
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return (scaleParameter.Fixed ? 0 : 1) + cov.GetNumberOfParameters(numberOfVariables);
+    }
+
+    public void SetParameter(double[] hyp) {
+      int i = 0;
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
+        i++;
+      }
+      cov.SetParameter(hyp.Skip(i).ToArray());
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return sf2 * cov.GetCovariance(x, i, j, columnIndices);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      yield return 2 * sf2 * cov.GetCovariance(x, i, j, columnIndices);
+      foreach (var g in cov.GetGradient(x, i, j, columnIndices))
+        yield return sf2 * g;
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return sf2 * cov.GetCrossCovariance(x, xt, i, j, columnIndices);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs	(revision 8929)
@@ -0,0 +1,136 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceSquaredExponentialArd", Description = "Squared exponential covariance function with automatic relevance determination for Gaussian processes.")]
+  public sealed class CovarianceSquaredExponentialArd : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private double sf2;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter { get { return scaleParameter; } }
+
+    [Storable]
+    private double[] inverseLength;
+    [Storable]
+    private readonly HyperParameter<DoubleArray> inverseLengthParameter;
+    public IValueParameter<DoubleArray> InverseLengthParameter { get { return inverseLengthParameter; } }
+
+    [StorableConstructor]
+    private CovarianceSquaredExponentialArd(bool deserializing) : base(deserializing) { }
+    private CovarianceSquaredExponentialArd(CovarianceSquaredExponentialArd original, Cloner cloner)
+      : base(original, cloner) {
+      this.sf2 = original.sf2;
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+
+      if (original.inverseLength != null) {
+        this.inverseLength = new double[original.inverseLength.Length];
+        Array.Copy(original.inverseLength, this.inverseLength, this.inverseLength.Length);
+      }
+      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
+
+      RegisterEvents();
+    }
+    public CovarianceSquaredExponentialArd()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the squared exponential covariance function with ARD.");
+      this.inverseLengthParameter = new HyperParameter<DoubleArray>("InverseLength", "The inverse length parameter for automatic relevance determination.");
+
+      Parameters.Add(scaleParameter);
+      Parameters.Add(inverseLengthParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceSquaredExponentialArd(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
+      Util.AttachArrayChangeHandler<DoubleArray, double>(inverseLengthParameter, () => {
+        inverseLength =
+          inverseLengthParameter.Value.ToArray();
+      });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return
+        (scaleParameter.Fixed ? 0 : 1) +
+        (inverseLengthParameter.Fixed ? 0 : numberOfVariables);
+    }
+
+
+    public void SetParameter(double[] hyp) {
+      int i = 0;
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
+        i++;
+      }
+      if (!inverseLengthParameter.Fixed) {
+        inverseLengthParameter.SetValue(new DoubleArray(hyp.Skip(i).Select(e => 1.0 / Math.Exp(e)).ToArray()));
+        i += hyp.Skip(i).Count();
+      }
+      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceSquaredExponentialArd", "hyp");
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+      return sf2 * Math.Exp(-d / 2.0);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+
+      for (int ii = 0; ii < inverseLength.Length; ii++) {
+        double sqrDist = Util.SqrDist(x[i, ii] * inverseLength[ii], x[j, ii] * inverseLength[ii]);
+        yield return sf2 * Math.Exp(-d / 2.0) * sqrDist;
+      }
+      yield return 2.0 * sf2 * Math.Exp(-d / 2.0);
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
+      return sf2 * Math.Exp(-d / 2.0);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialIso.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialIso.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialIso.cs	(revision 8929)
@@ -0,0 +1,131 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceSquaredExponentialIso",
+    Description = "Isotropic squared exponential covariance function for Gaussian processes.")]
+  public sealed class CovarianceSquaredExponentialIso : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private double sf2;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> scaleParameter;
+    public IValueParameter<DoubleValue> ScaleParameter { get { return scaleParameter; } }
+
+    [Storable]
+    private double inverseLength;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
+    public IValueParameter<DoubleValue> InverseLengthParameter { get { return inverseLengthParameter; } }
+
+    [StorableConstructor]
+    private CovarianceSquaredExponentialIso(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceSquaredExponentialIso(CovarianceSquaredExponentialIso original, Cloner cloner)
+      : base(original, cloner) {
+      this.sf2 = original.sf2;
+      this.scaleParameter = cloner.Clone(original.scaleParameter);
+
+      this.inverseLength = original.inverseLength;
+      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
+
+      RegisterEvents();
+    }
+
+    public CovarianceSquaredExponentialIso()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the isometric squared exponential covariance function.");
+      this.inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric squared exponential covariance function.");
+
+      Parameters.Add(scaleParameter);
+      Parameters.Add(inverseLengthParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceSquaredExponentialIso(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
+      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return
+        (scaleParameter.Fixed ? 0 : 1) +
+        (inverseLengthParameter.Fixed ? 0 : 1);
+    }
+
+    public void SetParameter(double[] hyp) {
+      int i = 0;
+      if (!inverseLengthParameter.Fixed) {
+        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
+        i++;
+      }
+      if (!scaleParameter.Fixed) {
+        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
+        i++;
+      }
+      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceSquaredExponentialIso", "hyp");
+    }
+
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+      return sf2 * Math.Exp(-d / 2.0);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      double d = i == j
+                   ? 0.0
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
+      double g = Math.Exp(-d / 2.0);
+      yield return sf2 * g * d;
+      yield return 2.0 * sf2 * g;
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
+      return sf2 * Math.Exp(-d / 2.0);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSum.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSum.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSum.cs	(revision 8929)
@@ -0,0 +1,90 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceSum",
+    Description = "Sum covariance function for Gaussian processes.")]
+  public sealed class CovarianceSum : Item, ICovarianceFunction {
+    [Storable]
+    private ItemList<ICovarianceFunction> terms;
+
+    [Storable]
+    private int numberOfVariables;
+    public ItemList<ICovarianceFunction> Terms {
+      get { return terms; }
+    }
+
+    [StorableConstructor]
+    private CovarianceSum(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceSum(CovarianceSum original, Cloner cloner)
+      : base(original, cloner) {
+      this.terms = cloner.Clone(original.terms);
+      this.numberOfVariables = original.numberOfVariables;
+    }
+
+    public CovarianceSum()
+      : base() {
+      this.terms = new ItemList<ICovarianceFunction>();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceSum(this, cloner);
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      this.numberOfVariables = numberOfVariables;
+      return terms.Select(t => t.GetNumberOfParameters(numberOfVariables)).Sum();
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (terms.Count == 0) throw new ArgumentException("At least one term is needed for sum covariance function.");
+      int offset = 0;
+      foreach (var t in terms) {
+        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
+        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
+        offset += numberOfParameters;
+      }
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return terms.Select(t => t.GetCovariance(x, i, j, columnIndices)).Sum();
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return terms.Select(t => t.GetGradient(x, i, j, columnIndices)).Aggregate(Enumerable.Concat);
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return terms.Select(t => t.GetCrossCovariance(x, xt, i, j, columnIndices)).Sum();
+    }
+  }
+}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs	(revision 8928)
+++ 	(revision )
@@ -1,65 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceLinear", Description = "Linear covariance function for Gaussian processes.")]
-  public sealed class CovarianceLinear : Item, ICovarianceFunction {
-    [StorableConstructor]
-    private CovarianceLinear(bool deserializing) : base(deserializing) { }
-    private CovarianceLinear(CovarianceLinear original, Cloner cloner)
-      : base(original, cloner) {
-    }
-    public CovarianceLinear()
-      : base() {
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceLinear(this, cloner);
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return 0;
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (hyp.Length > 0) throw new ArgumentException("No hyperparameters are allowed for the linear covariance function.");
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return Util.ScalarProd(x, i, j, 1, columnIndices);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      yield break;
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return Util.ScalarProd(x, i, xt, j);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinearArd.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinearArd.cs	(revision 8928)
+++ 	(revision )
@@ -1,110 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceLinearArd",
-    Description = "Linear covariance function with automatic relevance determination for Gaussian processes.")]
-  public sealed class CovarianceLinearArd : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private double[] inverseLength;
-    [Storable]
-    private readonly HyperParameter<DoubleArray> inverseLengthParameter;
-    public IValueParameter<DoubleArray> InverseLengthParameter {
-      get { return inverseLengthParameter; }
-    }
-
-    [StorableConstructor]
-    private CovarianceLinearArd(bool deserializing) : base(deserializing) { }
-    private CovarianceLinearArd(CovarianceLinearArd original, Cloner cloner)
-      : base(original, cloner) {
-      inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
-      if (original.inverseLength != null) {
-        this.inverseLength = new double[original.inverseLength.Length];
-        Array.Copy(original.inverseLength, inverseLength, inverseLength.Length);
-      }
-
-      RegisterEvents();
-    }
-    public CovarianceLinearArd()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      inverseLengthParameter = new HyperParameter<DoubleArray>("InverseLength",
-                                                               "The inverse length parameter for ARD.");
-      Parameters.Add(inverseLengthParameter);
-      RegisterEvents();
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceLinearArd(this, cloner);
-    }
-
-    // caching
-    private void RegisterEvents() {
-      Util.AttachArrayChangeHandler<DoubleArray, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.ToArray(); });
-    }
-
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      if (!inverseLengthParameter.Fixed)
-        return numberOfVariables;
-      else
-        return 0;
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (!inverseLengthParameter.Fixed && hyp.Length > 0) {
-        inverseLengthParameter.SetValue(new DoubleArray(hyp.Select(e => 1.0 / Math.Exp(e)).ToArray()));
-      } else throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceLinearArd", "hyp");
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return Util.ScalarProd(x, i, j, inverseLength, columnIndices);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
-
-      foreach (int k in columnIndices) {
-        yield return -2.0 * x[i, k] * x[j, k] * inverseLength[k] * inverseLength[k];
-      }
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return Util.ScalarProd(x, i, xt, j, inverseLength, columnIndices);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMask.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMask.cs	(revision 8928)
+++ 	(revision )
@@ -1,124 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceMask",
-    Description = "Masking covariance function for dimension selection can be used to apply a covariance function only on certain input dimensions.")]
-  public sealed class CovarianceMask : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private int[] selectedDimensions;
-    [Storable]
-    private readonly ValueParameter<IntArray> selectedDimensionsParameter;
-    public IValueParameter<IntArray> SelectedDimensionsParameter {
-      get { return selectedDimensionsParameter; }
-    }
-
-    [Storable]
-    private ICovarianceFunction cov;
-    [Storable]
-    private readonly ValueParameter<ICovarianceFunction> covParameter;
-    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
-      get { return covParameter; }
-    }
-
-    [StorableConstructor]
-    private CovarianceMask(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceMask(CovarianceMask original, Cloner cloner)
-      : base(original, cloner) {
-      this.selectedDimensionsParameter = cloner.Clone(original.selectedDimensionsParameter);
-      if (original.selectedDimensions != null) {
-        this.selectedDimensions = (int[])original.selectedDimensions.Clone();
-      }
-
-      this.covParameter = cloner.Clone(original.covParameter);
-      this.cov = cloner.Clone(original.cov);
-      RegisterEvents();
-    }
-
-    public CovarianceMask()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      this.selectedDimensionsParameter = new ValueParameter<IntArray>("SelectedDimensions", "The dimensions on which the specified covariance function should be applied to.");
-      this.covParameter = new ValueParameter<ICovarianceFunction>("CovarianceFunction", "The covariance function that should be scaled.", new CovarianceSquaredExponentialIso());
-      cov = covParameter.Value;
-
-      Parameters.Add(selectedDimensionsParameter);
-      Parameters.Add(covParameter);
-
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceMask(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachArrayChangeHandler<IntArray, int>(selectedDimensionsParameter, () => {
-        selectedDimensions = selectedDimensionsParameter.Value
-          .OrderBy(x => x)
-          .Distinct()
-          .ToArray();
-        if (selectedDimensions.Length == 0) selectedDimensions = null;
-      });
-      covParameter.ValueChanged += (sender, args) => { cov = covParameter.Value; };
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      if (selectedDimensions == null) return cov.GetNumberOfParameters(numberOfVariables);
-      else return cov.GetNumberOfParameters(selectedDimensions.Length);
-    }
-
-    public void SetParameter(double[] hyp) {
-      cov.SetParameter(hyp);
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return cov.GetCovariance(x, i, j, selectedDimensions);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return cov.GetGradient(x, i, j, selectedDimensions);
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return cov.GetCrossCovariance(x, xt, i, j, selectedDimensions);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMaternIso.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMaternIso.cs	(revision 8928)
+++ 	(revision )
@@ -1,177 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceMaternIso",
-    Description = "Matern covariance function for Gaussian processes.")]
-  public sealed class CovarianceMaternIso : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private double inverseLength;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
-    public IValueParameter<DoubleValue> InverseLengthParameter {
-      get { return inverseLengthParameter; }
-    }
-
-    [Storable]
-    private double sf2;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter {
-      get { return scaleParameter; }
-    }
-
-    [Storable]
-    private int d;
-    [Storable]
-    private readonly ConstrainedValueParameter<IntValue> dParameter;
-    public IConstrainedValueParameter<IntValue> DParameter {
-      get { return dParameter; }
-    }
-
-
-    [StorableConstructor]
-    private CovarianceMaternIso(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceMaternIso(CovarianceMaternIso original, Cloner cloner)
-      : base(original, cloner) {
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-      this.sf2 = original.sf2;
-      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
-      this.inverseLength = original.inverseLength;
-      this.dParameter = cloner.Clone(original.dParameter);
-      this.d = original.d;
-      RegisterEvents();
-    }
-
-    public CovarianceMaternIso()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric Matern covariance function.");
-      scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the isometric Matern covariance function.");
-      var validDValues = new ItemSet<IntValue>();
-      validDValues.Add((IntValue)new IntValue(1).AsReadOnly());
-      validDValues.Add((IntValue)new IntValue(3).AsReadOnly());
-      validDValues.Add((IntValue)new IntValue(5).AsReadOnly());
-      dParameter = new ConstrainedValueParameter<IntValue>("D", "The d parameter (allowed values: 1, 3, or 5) of the isometric Matern covariance function.", validDValues, validDValues.First());
-      d = dParameter.Value.Value;
-
-      Parameters.Add(inverseLengthParameter);
-      Parameters.Add(scaleParameter);
-      Parameters.Add(dParameter);
-
-      RegisterEvents();
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceMaternIso(this, cloner);
-    }
-
-    // caching
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
-      Util.AttachValueChangeHandler<IntValue, int>(dParameter, () => { d = dParameter.Value.Value; });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return
-        (inverseLengthParameter.Fixed ? 0 : 1) +
-        (scaleParameter.Fixed ? 0 : 1);
-    }
-
-    public void SetParameter(double[] hyp) {
-      int i = 0;
-      if (!inverseLengthParameter.Fixed) {
-        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
-        i++;
-      }
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
-        i++;
-      }
-      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceMaternIso", "hyp");
-    }
-
-
-    private double m(double t) {
-      double f;
-      switch (d) {
-        case 1: { f = 1; break; }
-        case 3: { f = 1 + t; break; }
-        case 5: { f = 1 + t * (1 + t / 3.0); break; }
-        default: throw new InvalidOperationException();
-      }
-      return f * Math.Exp(-t);
-    }
-
-    private double dm(double t) {
-      double df;
-      switch (d) {
-        case 1: { df = 1; break; }
-        case 3: { df = t; break; }
-        case 5: { df = t * (1 + t) / 3.0; break; }
-        default: throw new InvalidOperationException();
-      }
-      return df * t * Math.Exp(-t);
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double dist = i == j
-                   ? 0.0
-                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength, columnIndices));
-      return sf2 * m(dist);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double dist = i == j
-                   ? 0.0
-                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength, columnIndices));
-
-      yield return sf2 * dm(dist);
-      yield return 2 * sf2 * m(dist);
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      double dist = Math.Sqrt(Util.SqrDist(x, i, xt, j, Math.Sqrt(d) * inverseLength, columnIndices));
-      return sf2 * m(dist);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceNoise.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceNoise.cs	(revision 8928)
+++ 	(revision )
@@ -1,104 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceNoise",
-    Description = "Noise covariance function for Gaussian processes.")]
-  public sealed class CovarianceNoise : ParameterizedNamedItem, ICovarianceFunction {
-
-
-    [Storable]
-    private double sf2;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter {
-      get { return scaleParameter; }
-    }
-
-    [StorableConstructor]
-    private CovarianceNoise(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceNoise(CovarianceNoise original, Cloner cloner)
-      : base(original, cloner) {
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-      this.sf2 = original.sf2;
-      RegisterEvents();
-    }
-
-    public CovarianceNoise()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of noise.");
-      Parameters.Add(this.scaleParameter);
-
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceNoise(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return scaleParameter.Fixed ? 0 : 1;
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[0])));
-      } else {
-        if (hyp.Length > 0) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceNoise", "hyp");
-      }
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return i == j ? sf2 : 0.0;
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      yield return i == j ? 2 * sf2 : 0.0;
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return 0.0;
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs	(revision 8928)
+++ 	(revision )
@@ -1,159 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovariancePeriodic", Description = "Periodic covariance function for Gaussian processes.")]
-  public sealed class CovariancePeriodic : ParameterizedNamedItem, ICovarianceFunction {
-
-    [Storable]
-    private double scale;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter {
-      get { return scaleParameter; }
-    }
-
-    [Storable]
-    private double inverseLength;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
-    public IValueParameter<DoubleValue> InverseLengthParameter {
-      get { return inverseLengthParameter; }
-    }
-
-    [Storable]
-    private double period;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> periodParameter;
-    public IValueParameter<DoubleValue> PeriodParameter {
-      get { return periodParameter; }
-    }
-
-
-    [StorableConstructor]
-    private CovariancePeriodic(bool deserializing) : base(deserializing) { }
-    private CovariancePeriodic(CovariancePeriodic original, Cloner cloner)
-      : base(original, cloner) {
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
-      this.periodParameter = cloner.Clone(original.periodParameter);
-      this.scale = original.scale;
-      this.inverseLength = original.inverseLength;
-      this.period = original.period;
-
-      RegisterEvents();
-    }
-
-    public CovariancePeriodic()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of the periodic covariance function.");
-      inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter for the periodic covariance function.");
-      periodParameter = new HyperParameter<DoubleValue>("Period", "The period parameter for the periodic covariance function.");
-      Parameters.Add(scaleParameter);
-      Parameters.Add(inverseLengthParameter);
-      Parameters.Add(periodParameter);
-
-      RegisterEvents();
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovariancePeriodic(this, cloner);
-    }
-
-    // caching
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { scale = scaleParameter.Value.Value; });
-      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
-      Util.AttachValueChangeHandler<DoubleValue, double>(periodParameter, () => { period = periodParameter.Value.Value; });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return
-        (new[] { scaleParameter, inverseLengthParameter, periodParameter }).Count(p => !p.Fixed);
-    }
-
-    public void SetParameter(double[] hyp) {
-      int i = 0;
-      if (!inverseLengthParameter.Fixed) {
-        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
-        i++;
-      }
-      if (!periodParameter.Fixed) {
-        periodParameter.SetValue(new DoubleValue(Math.Exp(hyp[i])));
-        i++;
-      }
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
-        i++;
-      }
-      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovariancePeriod", "hyp");
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double k = i == j ? 0.0 : GetDistance(x, x, i, j, columnIndices);
-      k = Math.PI * k / period;
-      k = Math.Sin(k) * inverseLength;
-      k = k * k;
-
-      return scale * Math.Exp(-2.0 * k);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices) / period;
-      double gradient = Math.Sin(v) * inverseLength;
-      gradient *= gradient;
-      yield return 4.0 * scale * Math.Exp(-2.0 * gradient) * gradient;
-      double r = Math.Sin(v) * inverseLength;
-      yield return 4.0 * scale * inverseLength * Math.Exp(-2 * r * r) * r * Math.Cos(v) * v;
-      yield return 2.0 * scale * Math.Exp(-2 * gradient);
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      double k = GetDistance(x, xt, i, j, columnIndices);
-      k = Math.PI * k / period;
-      k = Math.Sin(k) * inverseLength;
-      k = k * k;
-
-      return scale * Math.Exp(-2.0 * k);
-    }
-
-    private double GetDistance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return Math.Sqrt(Util.SqrDist(x, i, xt, j, 1, columnIndices));
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceProduct.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceProduct.cs	(revision 8928)
+++ 	(revision )
@@ -1,98 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceProduct",
-    Description = "Product covariance function for Gaussian processes.")]
-  public sealed class CovarianceProduct : Item, ICovarianceFunction {
-    [Storable]
-    private ItemList<ICovarianceFunction> factors;
-
-    [Storable]
-    private int numberOfVariables;
-    public ItemList<ICovarianceFunction> Factors {
-      get { return factors; }
-    }
-
-    [StorableConstructor]
-    private CovarianceProduct(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceProduct(CovarianceProduct original, Cloner cloner)
-      : base(original, cloner) {
-      this.factors = cloner.Clone(original.factors);
-      this.numberOfVariables = original.numberOfVariables;
-    }
-
-    public CovarianceProduct()
-      : base() {
-      this.factors = new ItemList<ICovarianceFunction>();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceProduct(this, cloner);
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      this.numberOfVariables = numberOfVariables;
-      return factors.Select(f => f.GetNumberOfParameters(numberOfVariables)).Sum();
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (factors.Count == 0) throw new ArgumentException("at least one factor is necessary for the product covariance function.");
-      int offset = 0;
-      foreach (var t in factors) {
-        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
-        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
-        offset += numberOfParameters;
-      }
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).Aggregate((a, b) => a * b);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      var covariances = factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).ToArray();
-      for (int ii = 0; ii < factors.Count; ii++) {
-        foreach (var g in factors[ii].GetGradient(x, i, j, columnIndices)) {
-          double res = g;
-          for (int jj = 0; jj < covariances.Length; jj++)
-            if (ii != jj) res *= covariances[jj];
-          yield return res;
-        }
-      }
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return factors.Select(f => f.GetCrossCovariance(x, xt, i, j, columnIndices)).Aggregate((a, b) => a * b);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticArd.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticArd.cs	(revision 8928)
+++ 	(revision )
@@ -1,161 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceRationalQuadraticArd",
-    Description = "Rational quadratic covariance function with automatic relevance determination for Gaussian processes.")]
-  public sealed class CovarianceRationalQuadraticArd : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private double sf2;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter {
-      get { return scaleParameter; }
-    }
-
-    [Storable]
-    private double[] inverseLength;
-    [Storable]
-    private readonly HyperParameter<DoubleArray> inverseLengthParameter;
-    public IValueParameter<DoubleArray> InverseLengthParameter {
-      get { return inverseLengthParameter; }
-    }
-
-    [Storable]
-    private double shape;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> shapeParameter;
-    public IValueParameter<DoubleValue> ShapeParameter {
-      get { return shapeParameter; }
-    }
-
-    [StorableConstructor]
-    private CovarianceRationalQuadraticArd(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceRationalQuadraticArd(CovarianceRationalQuadraticArd original, Cloner cloner)
-      : base(original, cloner) {
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-      this.sf2 = original.sf2;
-
-      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
-      if (original.inverseLength != null) {
-        this.inverseLength = new double[original.inverseLength.Length];
-        Array.Copy(original.inverseLength, inverseLength, inverseLength.Length);
-      }
-
-      this.shapeParameter = cloner.Clone(original.shapeParameter);
-      this.shape = original.shape;
-
-      RegisterEvents();
-    }
-
-    public CovarianceRationalQuadraticArd()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the rational quadratic covariance function with ARD.");
-      this.inverseLengthParameter = new HyperParameter<DoubleArray>("InverseLength", "The inverse length parameter for automatic relevance determination.");
-      this.shapeParameter = new HyperParameter<DoubleValue>("Shape", "The shape parameter (alpha) of the rational quadratic covariance function with ARD.");
-
-      Parameters.Add(scaleParameter);
-      Parameters.Add(inverseLengthParameter);
-      Parameters.Add(shapeParameter);
-
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceRationalQuadraticArd(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
-      Util.AttachValueChangeHandler<DoubleValue, double>(shapeParameter, () => { shape = shapeParameter.Value.Value; });
-      Util.AttachArrayChangeHandler<DoubleArray, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.ToArray(); });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return
-        (scaleParameter.Fixed ? 0 : 1) +
-        (shapeParameter.Fixed ? 0 : 1) +
-        (inverseLengthParameter.Fixed ? 0 : numberOfVariables);
-    }
-
-    public void SetParameter(double[] hyp) {
-      int i = 0;
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
-        i++;
-      }
-      if (!shapeParameter.Fixed) {
-        shapeParameter.SetValue(new DoubleValue(Math.Exp(hyp[i])));
-        i++;
-      }
-      if (!inverseLengthParameter.Fixed) {
-        inverseLengthParameter.SetValue(new DoubleArray(hyp.Skip(i).Select(e => 1.0 / Math.Exp(e)).ToArray()));
-        i += hyp.Skip(i).Count();
-      }
-      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceRationalQuadraticArd", "hyp");
-    }
-
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-      double b = 1 + 0.5 * d / shape;
-      for (int k = 0; k < inverseLength.Length; k++) {
-        yield return sf2 * Math.Pow(b, -shape - 1) * Util.SqrDist(x[i, k] * inverseLength[k], x[j, k] * inverseLength[k]);
-      }
-      yield return 2 * sf2 * Math.Pow(b, -shape);
-      yield return sf2 * Math.Pow(b, -shape) * (0.5 * d / b - shape * Math.Log(b));
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
-      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticIso.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticIso.cs	(revision 8928)
+++ 	(revision )
@@ -1,150 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceRationalQuadraticIso",
-    Description = "Isotropic rational quadratic covariance function for Gaussian processes.")]
-  public sealed class CovarianceRationalQuadraticIso : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private double sf2;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter { get { return scaleParameter; } }
-
-    [Storable]
-    private double inverseLength;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
-    public IValueParameter<DoubleValue> InverseLengthParameter { get { return inverseLengthParameter; } }
-
-    [Storable]
-    private double shape;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> shapeParameter;
-    public IValueParameter<DoubleValue> ShapeParameter { get { return shapeParameter; } }
-
-    [StorableConstructor]
-    private CovarianceRationalQuadraticIso(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceRationalQuadraticIso(CovarianceRationalQuadraticIso original, Cloner cloner)
-      : base(original, cloner) {
-      this.sf2 = original.sf2;
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-
-      this.inverseLength = original.inverseLength;
-      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
-
-      this.shape = original.shape;
-      this.shapeParameter = cloner.Clone(original.shapeParameter);
-
-      RegisterEvents();
-    }
-
-    public CovarianceRationalQuadraticIso()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the isometric rational quadratic covariance function.");
-      this.inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric rational quadratic covariance function.");
-      this.shapeParameter = new HyperParameter<DoubleValue>("Shape", "The shape parameter (alpha) of the isometric rational quadratic covariance function.");
-
-      Parameters.Add(scaleParameter);
-      Parameters.Add(inverseLengthParameter);
-      Parameters.Add(shapeParameter);
-
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceRationalQuadraticIso(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
-      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
-      Util.AttachValueChangeHandler<DoubleValue, double>(shapeParameter, () => { shape = shapeParameter.Value.Value; });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return
-        (scaleParameter.Fixed ? 0 : 1) +
-        (inverseLengthParameter.Fixed ? 0 : 1) +
-        (shapeParameter.Fixed ? 0 : 1);
-    }
-
-    public void SetParameter(double[] hyp) {
-      int i = 0;
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
-        i++;
-      }
-      if (!shapeParameter.Fixed) {
-        shapeParameter.SetValue(new DoubleValue(Math.Exp(hyp[i])));
-        i++;
-      }
-      if (!inverseLengthParameter.Fixed) {
-        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
-        i++;
-      }
-      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceRationalQuadraticIso", "hyp");
-    }
-
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-
-      double b = 1 + 0.5 * d / shape;
-      yield return sf2 * Math.Pow(b, -shape - 1) * d;
-      yield return 2 * sf2 * Math.Pow(b, -shape);
-      yield return sf2 * Math.Pow(b, -shape) * (0.5 * d / b - shape * Math.Log(b));
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
-      return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceScale.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceScale.cs	(revision 8928)
+++ 	(revision )
@@ -1,123 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceScale",
-    Description = "Scale covariance function for Gaussian processes.")]
-  public sealed class CovarianceScale : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private double sf2;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter {
-      get { return scaleParameter; }
-    }
-
-    [Storable]
-    private ICovarianceFunction cov;
-    [Storable]
-    private readonly ValueParameter<ICovarianceFunction> covParameter;
-    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
-      get { return covParameter; }
-    }
-
-    [StorableConstructor]
-    private CovarianceScale(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceScale(CovarianceScale original, Cloner cloner)
-      : base(original, cloner) {
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-      this.sf2 = original.sf2;
-
-      this.covParameter = cloner.Clone(original.covParameter);
-      this.cov = cloner.Clone(original.cov);
-      RegisterEvents();
-    }
-
-    public CovarianceScale()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter.");
-      this.covParameter = new ValueParameter<ICovarianceFunction>("CovarianceFunction", "The covariance function that should be scaled.", new CovarianceSquaredExponentialIso());
-      cov = covParameter.Value;
-
-      Parameters.Add(this.scaleParameter);
-      Parameters.Add(covParameter);
-
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceScale(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
-      covParameter.ValueChanged += (sender, args) => { cov = covParameter.Value; };
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return (scaleParameter.Fixed ? 0 : 1) + cov.GetNumberOfParameters(numberOfVariables);
-    }
-
-    public void SetParameter(double[] hyp) {
-      int i = 0;
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
-        i++;
-      }
-      cov.SetParameter(hyp.Skip(i).ToArray());
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return sf2 * cov.GetCovariance(x, i, j, columnIndices);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      yield return 2 * sf2 * cov.GetCovariance(x, i, j, columnIndices);
-      foreach (var g in cov.GetGradient(x, i, j, columnIndices))
-        yield return sf2 * g;
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return sf2 * cov.GetCrossCovariance(x, xt, i, j, columnIndices);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialArd.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialArd.cs	(revision 8928)
+++ 	(revision )
@@ -1,136 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceSquaredExponentialArd", Description = "Squared exponential covariance function with automatic relevance determination for Gaussian processes.")]
-  public sealed class CovarianceSquaredExponentialArd : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private double sf2;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter { get { return scaleParameter; } }
-
-    [Storable]
-    private double[] inverseLength;
-    [Storable]
-    private readonly HyperParameter<DoubleArray> inverseLengthParameter;
-    public IValueParameter<DoubleArray> InverseLengthParameter { get { return inverseLengthParameter; } }
-
-    [StorableConstructor]
-    private CovarianceSquaredExponentialArd(bool deserializing) : base(deserializing) { }
-    private CovarianceSquaredExponentialArd(CovarianceSquaredExponentialArd original, Cloner cloner)
-      : base(original, cloner) {
-      this.sf2 = original.sf2;
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-
-      if (original.inverseLength != null) {
-        this.inverseLength = new double[original.inverseLength.Length];
-        Array.Copy(original.inverseLength, this.inverseLength, this.inverseLength.Length);
-      }
-      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
-
-      RegisterEvents();
-    }
-    public CovarianceSquaredExponentialArd()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the squared exponential covariance function with ARD.");
-      this.inverseLengthParameter = new HyperParameter<DoubleArray>("InverseLength", "The inverse length parameter for automatic relevance determination.");
-
-      Parameters.Add(scaleParameter);
-      Parameters.Add(inverseLengthParameter);
-
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceSquaredExponentialArd(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
-      Util.AttachArrayChangeHandler<DoubleArray, double>(inverseLengthParameter, () => {
-        inverseLength =
-          inverseLengthParameter.Value.ToArray();
-      });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return
-        (scaleParameter.Fixed ? 0 : 1) +
-        (inverseLengthParameter.Fixed ? 0 : numberOfVariables);
-    }
-
-
-    public void SetParameter(double[] hyp) {
-      int i = 0;
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
-        i++;
-      }
-      if (!inverseLengthParameter.Fixed) {
-        inverseLengthParameter.SetValue(new DoubleArray(hyp.Skip(i).Select(e => 1.0 / Math.Exp(e)).ToArray()));
-        i += hyp.Skip(i).Count();
-      }
-      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceSquaredExponentialArd", "hyp");
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-      return sf2 * Math.Exp(-d / 2.0);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-
-      for (int ii = 0; ii < inverseLength.Length; ii++) {
-        double sqrDist = Util.SqrDist(x[i, ii] * inverseLength[ii], x[j, ii] * inverseLength[ii]);
-        yield return sf2 * Math.Exp(-d / 2.0) * sqrDist;
-      }
-      yield return 2.0 * sf2 * Math.Exp(-d / 2.0);
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
-      return sf2 * Math.Exp(-d / 2.0);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialIso.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialIso.cs	(revision 8928)
+++ 	(revision )
@@ -1,131 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceSquaredExponentialIso",
-    Description = "Isotropic squared exponential covariance function for Gaussian processes.")]
-  public sealed class CovarianceSquaredExponentialIso : ParameterizedNamedItem, ICovarianceFunction {
-    [Storable]
-    private double sf2;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> scaleParameter;
-    public IValueParameter<DoubleValue> ScaleParameter { get { return scaleParameter; } }
-
-    [Storable]
-    private double inverseLength;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> inverseLengthParameter;
-    public IValueParameter<DoubleValue> InverseLengthParameter { get { return inverseLengthParameter; } }
-
-    [StorableConstructor]
-    private CovarianceSquaredExponentialIso(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceSquaredExponentialIso(CovarianceSquaredExponentialIso original, Cloner cloner)
-      : base(original, cloner) {
-      this.sf2 = original.sf2;
-      this.scaleParameter = cloner.Clone(original.scaleParameter);
-
-      this.inverseLength = original.inverseLength;
-      this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter);
-
-      RegisterEvents();
-    }
-
-    public CovarianceSquaredExponentialIso()
-      : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-
-      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the isometric squared exponential covariance function.");
-      this.inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric squared exponential covariance function.");
-
-      Parameters.Add(scaleParameter);
-      Parameters.Add(inverseLengthParameter);
-
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceSquaredExponentialIso(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; });
-      Util.AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return
-        (scaleParameter.Fixed ? 0 : 1) +
-        (inverseLengthParameter.Fixed ? 0 : 1);
-    }
-
-    public void SetParameter(double[] hyp) {
-      int i = 0;
-      if (!inverseLengthParameter.Fixed) {
-        inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i])));
-        i++;
-      }
-      if (!scaleParameter.Fixed) {
-        scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i])));
-        i++;
-      }
-      if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceSquaredExponentialIso", "hyp");
-    }
-
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-      return sf2 * Math.Exp(-d / 2.0);
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      double d = i == j
-                   ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
-      double g = Math.Exp(-d / 2.0);
-      yield return sf2 * g * d;
-      yield return 2.0 * sf2 * g;
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
-      return sf2 * Math.Exp(-d / 2.0);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSum.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSum.cs	(revision 8928)
+++ 	(revision )
@@ -1,90 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "CovarianceSum",
-    Description = "Sum covariance function for Gaussian processes.")]
-  public sealed class CovarianceSum : Item, ICovarianceFunction {
-    [Storable]
-    private ItemList<ICovarianceFunction> terms;
-
-    [Storable]
-    private int numberOfVariables;
-    public ItemList<ICovarianceFunction> Terms {
-      get { return terms; }
-    }
-
-    [StorableConstructor]
-    private CovarianceSum(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private CovarianceSum(CovarianceSum original, Cloner cloner)
-      : base(original, cloner) {
-      this.terms = cloner.Clone(original.terms);
-      this.numberOfVariables = original.numberOfVariables;
-    }
-
-    public CovarianceSum()
-      : base() {
-      this.terms = new ItemList<ICovarianceFunction>();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CovarianceSum(this, cloner);
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      this.numberOfVariables = numberOfVariables;
-      return terms.Select(t => t.GetNumberOfParameters(numberOfVariables)).Sum();
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (terms.Count == 0) throw new ArgumentException("At least one term is needed for sum covariance function.");
-      int offset = 0;
-      foreach (var t in terms) {
-        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
-        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
-        offset += numberOfParameters;
-      }
-    }
-
-    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return terms.Select(t => t.GetCovariance(x, i, j, columnIndices)).Sum();
-    }
-
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
-      return terms.Select(t => t.GetGradient(x, i, j, columnIndices)).Aggregate(Enumerable.Concat);
-    }
-
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
-      return terms.Select(t => t.GetCrossCovariance(x, xt, i, j, columnIndices)).Sum();
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanConst.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanConst.cs	(revision 8928)
+++ 	(revision )
@@ -1,90 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "MeanConst", Description = "Constant mean function for Gaussian processes.")]
-  public sealed class MeanConst : ParameterizedNamedItem, IMeanFunction {
-    [Storable]
-    private double c;
-    [Storable]
-    private readonly HyperParameter<DoubleValue> valueParameter;
-    public IValueParameter<DoubleValue> ValueParameter { get { return valueParameter; } }
-
-    [StorableConstructor]
-    private MeanConst(bool deserializing) : base(deserializing) { }
-    private MeanConst(MeanConst original, Cloner cloner)
-      : base(original, cloner) {
-      this.c = original.c;
-      this.valueParameter = cloner.Clone(original.valueParameter);
-      RegisterEvents();
-    }
-    public MeanConst()
-      : base() {
-      this.name = ItemName;
-      this.description = ItemDescription;
-
-      this.valueParameter = new HyperParameter<DoubleValue>("Value", "The constant value for the constant mean function.");
-      Parameters.Add(valueParameter);
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MeanConst(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachValueChangeHandler<DoubleValue, double>(valueParameter, () => { c = valueParameter.Value.Value; });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return valueParameter.Fixed ? 0 : 1;
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (!valueParameter.Fixed) {
-        valueParameter.SetValue(new DoubleValue(hyp[0]));
-      } else if (hyp.Length > 0)
-        throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for the constant mean function.", "hyp");
-    }
-
-    public double[] GetMean(double[,] x) {
-      return Enumerable.Repeat(c, x.GetLength(0)).ToArray();
-    }
-
-    public double[] GetGradients(int k, double[,] x) {
-      if (k > 0) throw new ArgumentException();
-      return Enumerable.Repeat(1.0, x.GetLength(0)).ToArray();
-    }
-  }
-}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanConst.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanConst.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanConst.cs	(revision 8929)
@@ -0,0 +1,90 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "MeanConst", Description = "Constant mean function for Gaussian processes.")]
+  public sealed class MeanConst : ParameterizedNamedItem, IMeanFunction {
+    [Storable]
+    private double c;
+    [Storable]
+    private readonly HyperParameter<DoubleValue> valueParameter;
+    public IValueParameter<DoubleValue> ValueParameter { get { return valueParameter; } }
+
+    [StorableConstructor]
+    private MeanConst(bool deserializing) : base(deserializing) { }
+    private MeanConst(MeanConst original, Cloner cloner)
+      : base(original, cloner) {
+      this.c = original.c;
+      this.valueParameter = cloner.Clone(original.valueParameter);
+      RegisterEvents();
+    }
+    public MeanConst()
+      : base() {
+      this.name = ItemName;
+      this.description = ItemDescription;
+
+      this.valueParameter = new HyperParameter<DoubleValue>("Value", "The constant value for the constant mean function.");
+      Parameters.Add(valueParameter);
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MeanConst(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachValueChangeHandler<DoubleValue, double>(valueParameter, () => { c = valueParameter.Value.Value; });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return valueParameter.Fixed ? 0 : 1;
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (!valueParameter.Fixed) {
+        valueParameter.SetValue(new DoubleValue(hyp[0]));
+      } else if (hyp.Length > 0)
+        throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for the constant mean function.", "hyp");
+    }
+
+    public double[] GetMean(double[,] x) {
+      return Enumerable.Repeat(c, x.GetLength(0)).ToArray();
+    }
+
+    public double[] GetGradients(int k, double[,] x) {
+      if (k > 0) throw new ArgumentException();
+      return Enumerable.Repeat(1.0, x.GetLength(0)).ToArray();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanLinear.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanLinear.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanLinear.cs	(revision 8929)
@@ -0,0 +1,100 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "MeanLinear", Description = "Linear mean function for Gaussian processes.")]
+  public sealed class MeanLinear : ParameterizedNamedItem, IMeanFunction {
+    [Storable]
+    private double[] weights;
+    [Storable]
+    private readonly HyperParameter<DoubleArray> weightsParameter;
+    public IValueParameter<DoubleArray> WeightsParameter { get { return weightsParameter; } }
+
+    [StorableConstructor]
+    private MeanLinear(bool deserializing) : base(deserializing) { }
+    private MeanLinear(MeanLinear original, Cloner cloner)
+      : base(original, cloner) {
+      if (original.weights != null) {
+        this.weights = new double[original.weights.Length];
+        Array.Copy(original.weights, weights, original.weights.Length);
+      }
+      weightsParameter = cloner.Clone(original.weightsParameter);
+      RegisterEvents();
+    }
+    public MeanLinear()
+      : base() {
+      this.weightsParameter = new HyperParameter<DoubleArray>("Weights", "The weights parameter for the linear mean function.");
+      Parameters.Add(weightsParameter);
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MeanLinear(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachArrayChangeHandler<DoubleArray, double>(weightsParameter, () => {
+        weights = weightsParameter.Value.ToArray();
+      });
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return weightsParameter.Fixed ? 0 : numberOfVariables;
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (!weightsParameter.Fixed) {
+        weightsParameter.SetValue(new DoubleArray(hyp));
+      } else if (hyp.Length != 0) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for the linear mean function.", "hyp");
+    }
+
+    public double[] GetMean(double[,] x) {
+      // sanity check
+      if (weights.Length != x.GetLength(1)) throw new ArgumentException("The number of hyperparameters must match the number of variables for the linear mean function.");
+      int cols = x.GetLength(1);
+      int n = x.GetLength(0);
+      return (from i in Enumerable.Range(0, n)
+              let rowVector = Enumerable.Range(0, cols).Select(j => x[i, j])
+              select Util.ScalarProd(weights, rowVector))
+        .ToArray();
+    }
+
+    public double[] GetGradients(int k, double[,] x) {
+      int cols = x.GetLength(1);
+      int n = x.GetLength(0);
+      if (k > cols) throw new ArgumentException();
+      return (Enumerable.Range(0, n).Select(r => x[r, k])).ToArray();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanProduct.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanProduct.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanProduct.cs	(revision 8929)
@@ -0,0 +1,104 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "MeanProduct", Description = "Product of mean functions for Gaussian processes.")]
+  public sealed class MeanProduct : Item, IMeanFunction {
+    [Storable]
+    private ItemList<IMeanFunction> factors;
+
+    [Storable]
+    private int numberOfVariables;
+
+    public ItemList<IMeanFunction> Factors {
+      get { return factors; }
+    }
+
+    [StorableConstructor]
+    private MeanProduct(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private MeanProduct(MeanProduct original, Cloner cloner)
+      : base(original, cloner) {
+      this.factors = cloner.Clone(original.factors);
+      this.numberOfVariables = original.numberOfVariables;
+    }
+
+    public MeanProduct() {
+      this.factors = new ItemList<IMeanFunction>();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MeanProduct(this, cloner);
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      this.numberOfVariables = numberOfVariables;
+      return factors.Select(t => t.GetNumberOfParameters(numberOfVariables)).Sum();
+    }
+
+    public void SetParameter(double[] hyp) {
+      int offset = 0;
+      foreach (var t in factors) {
+        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
+        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
+        offset += numberOfParameters;
+      }
+    }
+
+    public double[] GetMean(double[,] x) {
+      var res = factors.First().GetMean(x);
+      foreach (var t in factors.Skip(1)) {
+        var a = t.GetMean(x);
+        for (int i = 0; i < res.Length; i++) res[i] *= a[i];
+      }
+      return res;
+    }
+
+    public double[] GetGradients(int k, double[,] x) {
+      double[] res = Enumerable.Repeat(1.0, x.GetLength(0)).ToArray();
+      // find index of factor for the given k
+      int j = 0;
+      while (k >= factors[j].GetNumberOfParameters(numberOfVariables)) {
+        k -= factors[j].GetNumberOfParameters(numberOfVariables);
+        j++;
+      }
+      for (int i = 0; i < factors.Count; i++) {
+        var f = factors[i];
+        if (i == j) {
+          // multiply gradient
+          var g = f.GetGradients(k, x);
+          for (int ii = 0; ii < res.Length; ii++) res[ii] *= g[ii];
+        } else {
+          // multiply mean
+          var m = f.GetMean(x);
+          for (int ii = 0; ii < res.Length; ii++) res[ii] *= m[ii];
+        }
+      }
+      return res;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanSum.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanSum.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanSum.cs	(revision 8929)
@@ -0,0 +1,86 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "MeanSum", Description = "Sum of mean functions for Gaussian processes.")]
+  public sealed class MeanSum : Item, IMeanFunction {
+    [Storable]
+    private ItemList<IMeanFunction> terms;
+
+    [Storable]
+    private int numberOfVariables;
+    public ItemList<IMeanFunction> Terms {
+      get { return terms; }
+    }
+
+    [StorableConstructor]
+    private MeanSum(bool deserializing) : base(deserializing) { }
+    private MeanSum(MeanSum original, Cloner cloner)
+      : base(original, cloner) {
+      this.terms = cloner.Clone(original.terms);
+      this.numberOfVariables = original.numberOfVariables;
+    }
+    public MeanSum() {
+      this.terms = new ItemList<IMeanFunction>();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MeanSum(this, cloner);
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      this.numberOfVariables = numberOfVariables;
+      return terms.Select(t => t.GetNumberOfParameters(numberOfVariables)).Sum();
+    }
+
+    public void SetParameter(double[] hyp) {
+      int offset = 0;
+      foreach (var t in terms) {
+        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
+        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
+        offset += numberOfParameters;
+      }
+    }
+
+    public double[] GetMean(double[,] x) {
+      var res = terms.First().GetMean(x);
+      foreach (var t in terms.Skip(1)) {
+        var a = t.GetMean(x);
+        for (int i = 0; i < res.Length; i++) res[i] += a[i];
+      }
+      return res;
+    }
+
+    public double[] GetGradients(int k, double[,] x) {
+      int i = 0;
+      while (k >= terms[i].GetNumberOfParameters(numberOfVariables)) {
+        k -= terms[i].GetNumberOfParameters(numberOfVariables);
+        i++;
+      }
+      return terms[i].GetGradients(k, x);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanZero.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanZero.cs	(revision 8929)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanZero.cs	(revision 8929)
@@ -0,0 +1,60 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 System;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "MeanZero", Description = "Constant zero mean function for Gaussian processes.")]
+  public sealed class MeanZero : Item, IMeanFunction {
+    [StorableConstructor]
+    private MeanZero(bool deserializing) : base(deserializing) { }
+    private MeanZero(MeanZero original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public MeanZero() {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MeanZero(this, cloner);
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      return 0;
+    }
+
+    public void SetParameter(double[] hyp) {
+      if (hyp.Length > 0) throw new ArgumentException("No hyper-parameters allowed for zero mean function.", "hyp");
+    }
+
+    public double[] GetMean(double[,] x) {
+      return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray();
+    }
+
+    public double[] GetGradients(int k, double[,] x) {
+      if (k > 0) throw new ArgumentException();
+      return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray();
+    }
+  }
+}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanLinear.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanLinear.cs	(revision 8928)
+++ 	(revision )
@@ -1,100 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "MeanLinear", Description = "Linear mean function for Gaussian processes.")]
-  public sealed class MeanLinear : ParameterizedNamedItem, IMeanFunction {
-    [Storable]
-    private double[] weights;
-    [Storable]
-    private readonly HyperParameter<DoubleArray> weightsParameter;
-    public IValueParameter<DoubleArray> WeightsParameter { get { return weightsParameter; } }
-
-    [StorableConstructor]
-    private MeanLinear(bool deserializing) : base(deserializing) { }
-    private MeanLinear(MeanLinear original, Cloner cloner)
-      : base(original, cloner) {
-      if (original.weights != null) {
-        this.weights = new double[original.weights.Length];
-        Array.Copy(original.weights, weights, original.weights.Length);
-      }
-      weightsParameter = cloner.Clone(original.weightsParameter);
-      RegisterEvents();
-    }
-    public MeanLinear()
-      : base() {
-      this.weightsParameter = new HyperParameter<DoubleArray>("Weights", "The weights parameter for the linear mean function.");
-      Parameters.Add(weightsParameter);
-      RegisterEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MeanLinear(this, cloner);
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      Util.AttachArrayChangeHandler<DoubleArray, double>(weightsParameter, () => {
-        weights = weightsParameter.Value.ToArray();
-      });
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return weightsParameter.Fixed ? 0 : numberOfVariables;
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (!weightsParameter.Fixed) {
-        weightsParameter.SetValue(new DoubleArray(hyp));
-      } else if (hyp.Length != 0) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for the linear mean function.", "hyp");
-    }
-
-    public double[] GetMean(double[,] x) {
-      // sanity check
-      if (weights.Length != x.GetLength(1)) throw new ArgumentException("The number of hyperparameters must match the number of variables for the linear mean function.");
-      int cols = x.GetLength(1);
-      int n = x.GetLength(0);
-      return (from i in Enumerable.Range(0, n)
-              let rowVector = Enumerable.Range(0, cols).Select(j => x[i, j])
-              select Util.ScalarProd(weights, rowVector))
-        .ToArray();
-    }
-
-    public double[] GetGradients(int k, double[,] x) {
-      int cols = x.GetLength(1);
-      int n = x.GetLength(0);
-      if (k > cols) throw new ArgumentException();
-      return (Enumerable.Range(0, n).Select(r => x[r, k])).ToArray();
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanProduct.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanProduct.cs	(revision 8928)
+++ 	(revision )
@@ -1,104 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "MeanProduct", Description = "Product of mean functions for Gaussian processes.")]
-  public sealed class MeanProduct : Item, IMeanFunction {
-    [Storable]
-    private ItemList<IMeanFunction> factors;
-
-    [Storable]
-    private int numberOfVariables;
-
-    public ItemList<IMeanFunction> Factors {
-      get { return factors; }
-    }
-
-    [StorableConstructor]
-    private MeanProduct(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private MeanProduct(MeanProduct original, Cloner cloner)
-      : base(original, cloner) {
-      this.factors = cloner.Clone(original.factors);
-      this.numberOfVariables = original.numberOfVariables;
-    }
-
-    public MeanProduct() {
-      this.factors = new ItemList<IMeanFunction>();
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MeanProduct(this, cloner);
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      this.numberOfVariables = numberOfVariables;
-      return factors.Select(t => t.GetNumberOfParameters(numberOfVariables)).Sum();
-    }
-
-    public void SetParameter(double[] hyp) {
-      int offset = 0;
-      foreach (var t in factors) {
-        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
-        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
-        offset += numberOfParameters;
-      }
-    }
-
-    public double[] GetMean(double[,] x) {
-      var res = factors.First().GetMean(x);
-      foreach (var t in factors.Skip(1)) {
-        var a = t.GetMean(x);
-        for (int i = 0; i < res.Length; i++) res[i] *= a[i];
-      }
-      return res;
-    }
-
-    public double[] GetGradients(int k, double[,] x) {
-      double[] res = Enumerable.Repeat(1.0, x.GetLength(0)).ToArray();
-      // find index of factor for the given k
-      int j = 0;
-      while (k >= factors[j].GetNumberOfParameters(numberOfVariables)) {
-        k -= factors[j].GetNumberOfParameters(numberOfVariables);
-        j++;
-      }
-      for (int i = 0; i < factors.Count; i++) {
-        var f = factors[i];
-        if (i == j) {
-          // multiply gradient
-          var g = f.GetGradients(k, x);
-          for (int ii = 0; ii < res.Length; ii++) res[ii] *= g[ii];
-        } else {
-          // multiply mean
-          var m = f.GetMean(x);
-          for (int ii = 0; ii < res.Length; ii++) res[ii] *= m[ii];
-        }
-      }
-      return res;
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanSum.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanSum.cs	(revision 8928)
+++ 	(revision )
@@ -1,86 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "MeanSum", Description = "Sum of mean functions for Gaussian processes.")]
-  public sealed class MeanSum : Item, IMeanFunction {
-    [Storable]
-    private ItemList<IMeanFunction> terms;
-
-    [Storable]
-    private int numberOfVariables;
-    public ItemList<IMeanFunction> Terms {
-      get { return terms; }
-    }
-
-    [StorableConstructor]
-    private MeanSum(bool deserializing) : base(deserializing) { }
-    private MeanSum(MeanSum original, Cloner cloner)
-      : base(original, cloner) {
-      this.terms = cloner.Clone(original.terms);
-      this.numberOfVariables = original.numberOfVariables;
-    }
-    public MeanSum() {
-      this.terms = new ItemList<IMeanFunction>();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MeanSum(this, cloner);
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      this.numberOfVariables = numberOfVariables;
-      return terms.Select(t => t.GetNumberOfParameters(numberOfVariables)).Sum();
-    }
-
-    public void SetParameter(double[] hyp) {
-      int offset = 0;
-      foreach (var t in terms) {
-        var numberOfParameters = t.GetNumberOfParameters(numberOfVariables);
-        t.SetParameter(hyp.Skip(offset).Take(numberOfParameters).ToArray());
-        offset += numberOfParameters;
-      }
-    }
-
-    public double[] GetMean(double[,] x) {
-      var res = terms.First().GetMean(x);
-      foreach (var t in terms.Skip(1)) {
-        var a = t.GetMean(x);
-        for (int i = 0; i < res.Length; i++) res[i] += a[i];
-      }
-      return res;
-    }
-
-    public double[] GetGradients(int k, double[,] x) {
-      int i = 0;
-      while (k >= terms[i].GetNumberOfParameters(numberOfVariables)) {
-        k -= terms[i].GetNumberOfParameters(numberOfVariables);
-        i++;
-      }
-      return terms[i].GetGradients(k, x);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanZero.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanZero.cs	(revision 8928)
+++ 	(revision )
@@ -1,60 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 System;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item(Name = "MeanZero", Description = "Constant zero mean function for Gaussian processes.")]
-  public sealed class MeanZero : Item, IMeanFunction {
-    [StorableConstructor]
-    private MeanZero(bool deserializing) : base(deserializing) { }
-    private MeanZero(MeanZero original, Cloner cloner)
-      : base(original, cloner) {
-    }
-    public MeanZero() {
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MeanZero(this, cloner);
-    }
-
-    public int GetNumberOfParameters(int numberOfVariables) {
-      return 0;
-    }
-
-    public void SetParameter(double[] hyp) {
-      if (hyp.Length > 0) throw new ArgumentException("No hyper-parameters allowed for zero mean function.", "hyp");
-    }
-
-    public double[] GetMean(double[,] x) {
-      return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray();
-    }
-
-    public double[] GetGradients(int k, double[,] x) {
-      if (k > 0) throw new ArgumentException();
-      return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray();
-    }
-  }
-}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 8928)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 8929)
@@ -120,34 +120,34 @@
     </Compile>
     <Compile Include="FixedDataAnalysisAlgorithm.cs" />
-    <Compile Include="GaussianProcess\CovarianceMask.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceConst.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceLinear.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceLinearArd.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceMask.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceMaternIso.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceNoise.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovariancePeriodic.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceProduct.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceRationalQuadraticArd.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceRationalQuadraticIso.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceScale.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceSquaredExponentialArd.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceSquaredExponentialIso.cs" />
+    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceSum.cs" />
     <Compile Include="GaussianProcess\GaussianProcessClassificationSolutionCreator.cs" />
     <Compile Include="GaussianProcess\GaussianProcessClassificationModelCreator.cs" />
     <Compile Include="GaussianProcess\GaussianProcessClassification.cs" />
-    <Compile Include="GaussianProcess\CovarianceProduct.cs" />
-    <Compile Include="GaussianProcess\CovarianceScale.cs" />
-    <Compile Include="GaussianProcess\CovarianceRationalQuadraticArd.cs" />
-    <Compile Include="GaussianProcess\CovarianceRationalQuadraticIso.cs" />
-    <Compile Include="GaussianProcess\CovarianceSquaredExponentialArd.cs" />
-    <Compile Include="GaussianProcess\CovarianceSquaredExponentialIso.cs" />
     <Compile Include="GaussianProcess\HyperParameter.cs" />
-    <Compile Include="GaussianProcess\CovarianceMaternIso.cs" />
-    <Compile Include="GaussianProcess\CovarianceLinearArd.cs" />
-    <Compile Include="GaussianProcess\CovarianceNoise.cs" />
-    <Compile Include="GaussianProcess\CovarianceConst.cs" />
-    <Compile Include="GaussianProcess\MeanProduct.cs" />
-    <Compile Include="GaussianProcess\MeanSum.cs" />
-    <Compile Include="GaussianProcess\CovarianceSum.cs" />
-    <Compile Include="GaussianProcess\CovariancePeriodic.cs" />
+    <Compile Include="GaussianProcess\MeanFunctions\MeanConst.cs" />
+    <Compile Include="GaussianProcess\MeanFunctions\MeanLinear.cs" />
+    <Compile Include="GaussianProcess\MeanFunctions\MeanProduct.cs" />
+    <Compile Include="GaussianProcess\MeanFunctions\MeanSum.cs" />
+    <Compile Include="GaussianProcess\MeanFunctions\MeanZero.cs" />
     <Compile Include="GaussianProcess\GaussianProcessHyperparameterInitializer.cs" />
     <Compile Include="GaussianProcess\GaussianProcessRegressionSolutionCreator.cs" />
     <Compile Include="GaussianProcess\GaussianProcessRegressionModelCreator.cs" />
-    <Compile Include="GaussianProcess\CovarianceLinear.cs" />
     <Compile Include="GaussianProcess\GaussianProcessModelCreator.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="GaussianProcess\MeanLinear.cs" />
     <Compile Include="GaussianProcess\Util.cs" />
-    <Compile Include="GaussianProcess\MeanZero.cs" />
-    <Compile Include="GaussianProcess\MeanConst.cs" />
     <Compile Include="GaussianProcess\IMeanFunction.cs" />
     <Compile Include="GaussianProcess\GaussianProcessModel.cs" />
