Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/14/12 13:25:17 (12 years ago)
Author:
gkronber
Message:

#1902 changed interface for covariance functions to improve readability, fixed several bugs in the covariance functions and in the line chart for Gaussian process models.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceNoise.cs

    r8473 r8484  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    5960      this.sf2 = Math.Exp(2 * hyp[0]);
    6061    }
    61     public void SetData(double[,] x) {
    62       // nothing to do
     62
     63    public double GetCovariance(double[,] x, int i, int j) {
     64      return sf2;
    6365    }
    6466
    65 
    66     public void SetData(double[,] x, double[,] xt) {
    67       // nothing to do
     67    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
     68      yield return 2 * sf2;
    6869    }
    6970
    70     public double GetCovariance(int i, int j) {
    71       if (i == j) return sf2;
    72       else return 0.0;
    73     }
    74 
    75     public double GetGradient(int i, int j, int k) {
    76       if (k != 0) throw new ArgumentException("CovarianceConst has only one hyperparameters", "k");
    77       if (i == j)
    78         return 2 * sf2;
    79       else
    80         return 0.0;
     71    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
     72      return 0.0;
    8173    }
    8274  }
Note: See TracChangeset for help on using the changeset viewer.