Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/02/12 19:37:10 (12 years ago)
Author:
gkronber
Message:

#1902 introduced upper limit for scale of SEard covariance function

File:
1 edited

Legend:

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

    r8401 r8403  
    7373      this.symmetric = false;
    7474
    75       this.l = new double[hyp.Length - 1];
    76       Array.Copy(hyp, l, l.Length);
     75      this.l = hyp.Take(hyp.Length - 1).Select(Math.Exp).ToArray();
    7776      this.sf2 = Math.Exp(2 * hyp[hyp.Length - 1]);
     77      sf2 = Math.Min(10E6, sf2); // upper limit for the scale
     78
    7879      sd = null;
    7980    }
     
    9091      var sd = new double[rows];
    9192      for (int i = 0; i < rows; i++) {
    92         sd[i] = Util.SqrDist(Util.GetRow(x, i).Select((e, k) => e / l[k]), Util.GetRow(xt, i).Select((e, k) => e / l[k]));
     93        sd[i] = Util.SqrDist(
     94          Util.GetRow(x, i).Select((e, k) => e / l[k]),
     95          Util.GetRow(xt, i).Select((e, k) => e / l[k]));
    9396      }
    9497      return sd.Select(d => sf2 * Math.Exp(-d / 2.0)).ToArray();
Note: See TracChangeset for help on using the changeset viewer.