Changeset 8463 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs
- Timestamp:
- 08/09/12 16:32:44 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs
r8455 r8463 102 102 } 103 103 104 105 public double[] GetDiagonalCovariances() {106 if (x != xt) throw new InvalidOperationException();107 int rows = x.GetLength(0);108 var cov = new double[rows];109 for (int i = 0; i < rows; i++) {110 double k = Math.Sqrt(Util.SqrDist(Util.GetRow(x, i), Util.GetRow(xt, i)));111 k = Math.PI * k / p;112 k = Math.Sin(k) / l;113 k = k * k;114 cov[i] = sf2 * Math.Exp(-2.0 * k);115 }116 return cov;117 }118 119 104 public double GetGradient(int i, int j, int k) { 120 105 double v = Math.PI * sd[i, j] / p;
Note: See TracChangeset
for help on using the changeset viewer.