Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs	(revision 14864)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs	(revision 14899)
@@ -46,4 +46,10 @@
 
     [Storable]
+    private double negativeLooPredictiveProbability;
+    public double NegativeLooPredictiveProbability {
+      get { return negativeLooPredictiveProbability; }
+    }
+
+    [Storable]
     private double[] hyperparameterGradients;
     public double[] HyperparameterGradients {
@@ -128,4 +134,5 @@
       this.trainingDataset = cloner.Clone(original.trainingDataset);
       this.negativeLogLikelihood = original.negativeLogLikelihood;
+      this.negativeLooPredictiveProbability = original.negativeLooPredictiveProbability;
       this.sqrSigmaNoise = original.sqrSigmaNoise;
       if (original.meanParameter != null) {
@@ -217,4 +224,21 @@
       alglib.spdmatrixcholeskyinverse(ref lCopy, n, false, out info, out matInvRep);
       if (info != 1) throw new ArgumentException("Can't invert matrix to calculate gradients.");
+
+      // LOOCV log predictive probability (GPML page 116 and 117)
+      var sumLoo = 0.0;
+      var ki = new double[n];
+      for (int i = 0; i < n; i++) {
+        for (int j = 0; j < n; j++) ki[j] = cov.Covariance(x, i, j);
+        var yi = Util.ScalarProd(ki, alpha);
+        // r = [inv(K)]_i,i
+        var yi_loo = yi - alpha[i] / lCopy[i, i] / sqrSigmaNoise;
+        var s2_loo = sqrSigmaNoise / lCopy[i, i];
+        var err = ym[i] - yi_loo;
+        var nll_loo = Math.Log(s2_loo) + err * err / s2_loo;
+        sumLoo += nll_loo;
+      }
+      sumLoo += n * Math.Log(2 * Math.PI);
+      negativeLooPredictiveProbability = 0.5 * sumLoo;
+
       for (int i = 0; i < n; i++) {
         for (int j = 0; j <= i; j++)
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModelCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModelCreator.cs	(revision 14864)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModelCreator.cs	(revision 14899)
@@ -37,4 +37,5 @@
     private const string ModelParameterName = "Model";
     private const string NegativeLogLikelihoodParameterName = "NegativeLogLikelihood";
+    private const string NegativeLogPredictiveProbabilityParameterName = "NegativeLogPredictiveProbability (LOOCV)";
     private const string HyperparameterGradientsParameterName = "HyperparameterGradients";
     protected const string ScaleInputValuesParameterName = "ScaleInputValues";
@@ -60,4 +61,7 @@
     public ILookupParameter<DoubleValue> NegativeLogLikelihoodParameter {
       get { return (ILookupParameter<DoubleValue>)Parameters[NegativeLogLikelihoodParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> NegativeLogPredictiveProbabilityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[NegativeLogPredictiveProbabilityParameterName]; }
     }
     public ILookupParameter<BoolValue> ScaleInputValuesParameter {
@@ -86,4 +90,5 @@
       Parameters.Add(new LookupParameter<RealVector>(HyperparameterGradientsParameterName, "The gradients of the hyperparameters for the produced Gaussian process model (necessary for hyperparameter optimization)"));
       Parameters.Add(new LookupParameter<DoubleValue>(NegativeLogLikelihoodParameterName, "The negative log-likelihood of the produced Gaussian process model given the data."));
+      Parameters.Add(new LookupParameter<DoubleValue>(NegativeLogPredictiveProbabilityParameterName, "The leave-one-out-cross-validation negative log predictive probability of the produced Gaussian process model given the data."));
 
 
@@ -100,4 +105,8 @@
         Parameters[ScaleInputValuesParameterName].Hidden = true;
       }
+      if (!Parameters.ContainsKey(NegativeLogPredictiveProbabilityParameterName)) {
+        Parameters.Add(new LookupParameter<DoubleValue>(NegativeLogPredictiveProbabilityParameterName,
+          "The leave-one-out-cross-validation negative log predictive probability of the produced Gaussian process model given the data."));
+      }
     }
   }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionModelCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionModelCreator.cs	(revision 14864)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionModelCreator.cs	(revision 14899)
@@ -65,4 +65,5 @@
         ModelParameter.ActualValue = model;
         NegativeLogLikelihoodParameter.ActualValue = new DoubleValue(model.NegativeLogLikelihood);
+        NegativeLogPredictiveProbabilityParameter.ActualValue = new DoubleValue(model.NegativeLooPredictiveProbability);
         HyperparameterGradientsParameter.ActualValue = new RealVector(model.HyperparameterGradients);
         return base.Apply();
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolutionCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolutionCreator.cs	(revision 14864)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolutionCreator.cs	(revision 14899)
@@ -41,4 +41,5 @@
     private const string TestRSquaredResultName = "Test R²";
     private const string CreateSolutionParameterName = "CreateSolution";
+    private const string NegLogPredictiveProbability = "NegativeLogPredictiveProbability (LOO-CV)";
 
     #region Parameter Properties
@@ -108,8 +109,12 @@
                                  "The Pearson's R² of the Gaussian process solution on the test partition.",
                                  new DoubleValue(s.TestRSquared)));
+          results.Add(new Result(NegLogPredictiveProbability, 
+                                 "The leave-one-out-cross-validation negative log predictive probability.", 
+                                 new DoubleValue(m.NegativeLooPredictiveProbability)));
         } else {
           results[SolutionParameterName].Value = s;
           results[TrainingRSquaredResultName].Value = new DoubleValue(s.TrainingRSquared);
           results[TestRSquaredResultName].Value = new DoubleValue(s.TestRSquared);
+          results[NegLogPredictiveProbability].Value = new DoubleValue(m.NegativeLooPredictiveProbability);
         }
       }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs	(revision 14864)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs	(revision 14899)
@@ -28,4 +28,5 @@
   public interface IGaussianProcessModel : IConfidenceRegressionModel {
     double NegativeLogLikelihood { get; }
+    double NegativeLooPredictiveProbability { get; }
     double SigmaNoise { get; }
     IMeanFunction MeanFunction { get; }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModelCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModelCreator.cs	(revision 14864)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModelCreator.cs	(revision 14899)
@@ -23,5 +23,4 @@
 using HeuristicLab.Data;
 using HeuristicLab.Encodings.RealVectorEncoding;
-using HeuristicLab.Problems.DataAnalysis;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -36,4 +35,5 @@
     ILookupParameter<RealVector> HyperparameterGradientsParameter { get; }
     ILookupParameter<DoubleValue> NegativeLogLikelihoodParameter { get; }
+    ILookupParameter<DoubleValue> NegativeLogPredictiveProbabilityParameter { get; }
   }
 }
