Changeset 9543
- Timestamp:
- 05/27/13 19:43:08 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePiecewisePolynomial.cs
r9537 r9543 140 140 var cov = new ParameterizedCovarianceFunction(); 141 141 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)); 143 143 return scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k); 144 144 }; 145 145 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)); 147 147 return scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k); 148 148 }; … … 152 152 153 153 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)); 155 155 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)); 156 156 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.