Changeset 15165
- Timestamp:
- 07/06/17 17:58:04 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
r15163 r15165 230 230 for (int i = 0; i < n; i++) { 231 231 for (int j = 0; j < n; j++) ki[j] = cov.Covariance(x, i, j); 232 ki[i] += sqrSigmaNoise; 233 232 234 var yi = Util.ScalarProd(ki, alpha); 233 235 var yi_loo = yi - alpha[i] / (lCopy[i, i] / sqrSigmaNoise); 234 var s2_loo = sqrSigmaNoise / lCopy[i, i];236 var s2_loo = 1.0 / (lCopy[i, i] / sqrSigmaNoise); 235 237 var err = ym[i] - yi_loo; 236 var nll_loo = Math.Log(s2_loo) +err * err / s2_loo;238 var nll_loo = 0.5 * Math.Log(2 * Math.PI * s2_loo) + 0.5 * err * err / s2_loo; 237 239 sumLoo += nll_loo; 238 240 } 239 sumLoo += n * Math.Log(2 * Math.PI); 240 loocvNegLogPseudoLikelihood = 0.5 * sumLoo; 241 loocvNegLogPseudoLikelihood = sumLoo; 241 242 242 243 for (int i = 0; i < n; i++) {
Note: See TracChangeset
for help on using the changeset viewer.