Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/21/12 18:45:15 (12 years ago)
Author:
gkronber
Message:

#1902: added masking covariance function and made necessary changes to interface and utility class.

File:
1 edited

Legend:

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

    r8620 r8678  
    7272      this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter.");
    7373      this.covParameter = new ValueParameter<ICovarianceFunction>("CovarianceFunction", "The covariance function that should be scaled.", new CovarianceSquaredExponentialIso());
     74      cov = covParameter.Value;
    7475
    7576      Parameters.Add(this.scaleParameter);
     
    106107    }
    107108
    108     public double GetCovariance(double[,] x, int i, int j) {
    109       return sf2 * cov.GetCovariance(x, i, j);
     109    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
     110      return sf2 * cov.GetCovariance(x, i, j, columnIndices);
    110111    }
    111112
    112     public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
    113       yield return 2 * sf2 * cov.GetCovariance(x, i, j);
    114       foreach (var g in cov.GetGradient(x, i, j))
     113    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
     114      yield return 2 * sf2 * cov.GetCovariance(x, i, j, columnIndices);
     115      foreach (var g in cov.GetGradient(x, i, j, columnIndices))
    115116        yield return sf2 * g;
    116117    }
    117118
    118     public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
    119       return sf2 * cov.GetCrossCovariance(x, xt, i, j);
     119    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
     120      return sf2 * cov.GetCrossCovariance(x, xt, i, j, columnIndices);
    120121    }
    121122  }
Note: See TracChangeset for help on using the changeset viewer.