Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9543


Ignore:
Timestamp:
05/27/13 19:43:08 (11 years ago)
Author:
gkronber
Message:

#2059: fixed problem in piecewise polynomial covariance function in combination with dimension masking

File:
1 edited

Legend:

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

    r9537 r9543  
    140140      var cov = new ParameterizedCovarianceFunction();
    141141      cov.Covariance = (x, i, j) => {
    142         double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length));
     142        double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length, columnIndices));
    143143        return scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k);
    144144      };
    145145      cov.CrossCovariance = (x, xt, i, j) => {
    146         double k = Math.Sqrt(Util.SqrDist(x, i, xt, j, 1.0 / length));
     146        double k = Math.Sqrt(Util.SqrDist(x, i, xt, j, 1.0 / length, columnIndices));
    147147        return scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k);
    148148      };
     
    152152
    153153    private static IEnumerable<double> GetGradient(double[,] x, int i, int j, double length, double scale, int v, double exp, Func<double, double> f, Func<double, double> df, IEnumerable<int> columnIndices) {
    154       double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length));
     154      double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length, columnIndices));
    155155      yield return scale * Math.Pow(Math.Max(1.0 - k, 0), exp + v - 1) * k * ((exp + v) * f(k) - Math.Max(1 - k, 0) * df(k));
    156156      yield return 2.0 * scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k);
Note: See TracChangeset for help on using the changeset viewer.