Changeset 8562
- Timestamp:
- 09/04/12 09:50:52 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionLineChartView.cs
r8484 r8562 114 114 115 115 this.ToggleSeriesData(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); 116 117 // the series have been added in different order than in the normal line chart 118 // --> adapt coloring; 119 var s1Color = chart.Series[0].Color; 120 var s2Color = chart.Series[1].Color; 121 var s3Color = chart.Series[2].Color; 122 var s4Color = chart.Series[3].Color; 123 124 chart.Series[3].Color = s1Color; 125 chart.Series[0].Color = s2Color; 126 chart.Series[1].Color = s3Color; 127 chart.Series[2].Color = s4Color; 116 128 117 129 UpdateCursorInterval(); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs
r8484 r8562 51 51 52 52 public double GetCovariance(double[,] x, int i, int j) { 53 return Util.ScalarProd( Util.GetRow(x, i), Util.GetRow(x, j));53 return Util.ScalarProd(x, i, j); 54 54 } 55 55 … … 59 59 60 60 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) { 61 return Util.ScalarProd( Util.GetRow(x, i), Util.GetRow(xt, j));61 return Util.ScalarProd(x, i, xt, j); 62 62 } 63 63 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinearArd.cs
r8484 r8562 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Common; … … 32 33 public class CovarianceLinearArd : Item, ICovarianceFunction { 33 34 [Storable] 34 private double[,] x; 35 [Storable] 36 private double[,] xt; 37 38 [Storable] 39 private double[] l; 40 public double[] Length { 35 private double[] inverseLength; 36 public double[] InverseLength { 41 37 get { 42 double[] res = new double[l.Length]; 43 Array.Copy(l, res, res.Length); 38 if (inverseLength == null) return null; 39 double[] res = new double[inverseLength.Length]; 40 Array.Copy(inverseLength, res, res.Length); 44 41 return res; 45 42 } 46 43 } 47 44 48 private double[,] k;49 private bool symmetric;50 51 52 45 public int GetNumberOfParameters(int numberOfVariables) { 53 46 return numberOfVariables; 54 47 } 48 55 49 [StorableConstructor] 56 50 protected CovarianceLinearArd(bool deserializing) : base(deserializing) { } 57 51 protected CovarianceLinearArd(CovarianceLinearArd original, Cloner cloner) 58 52 : base(original, cloner) { 59 if (original.x != null) { 60 this.x = new double[original.x.GetLength(0), original.x.GetLength(1)]; 61 Array.Copy(original.x, this.x, x.Length); 62 63 this.xt = new double[original.xt.GetLength(0), original.xt.GetLength(1)]; 64 Array.Copy(original.xt, this.xt, xt.Length); 65 66 this.k = new double[original.k.GetLength(0), original.k.GetLength(1)]; 67 Array.Copy(original.k, this.k, k.Length); 68 this.l = new double[original.l.GetLength(0)]; 69 Array.Copy(original.l, this.l, l.Length); 70 } 71 this.symmetric = original.symmetric; 53 this.inverseLength = original.InverseLength; // array is copied in the getter 72 54 } 73 55 public CovarianceLinearArd() … … 80 62 81 63 public void SetParameter(double[] hyp) { 82 l = hyp.Select(Math.Exp).ToArray();64 inverseLength = hyp.Select(e => 1.0 / Math.Exp(e)).ToArray(); 83 65 } 84 66 85 public void SetData(double[,] x) { 86 SetData(x, x); 87 this.symmetric = true; 67 public double GetCovariance(double[,] x, int i, int j) { 68 return Util.ScalarProd(x, i, j, inverseLength); 88 69 } 89 70 90 public void SetData(double[,] x, double[,] xt) { 91 this.x = x; 92 this.xt = xt; 93 this.symmetric = false; 94 95 k = null; 71 public IEnumerable<double> GetGradient(double[,] x, int i, int j) { 72 for (int k = 0; k < inverseLength.Length; k++) { 73 yield return -2.0 * x[i, k] * x[j, k] * inverseLength[k] * inverseLength[k]; 74 } 96 75 } 97 76 98 public double GetCovariance(int i, int j) { 99 if (k == null) CalculateInnerProduct(); 100 return k[i, j]; 101 } 102 103 public double GetGradient(int i, int j, int k) { 104 105 } 106 107 108 private void CalculateInnerProduct() { 109 if (x.GetLength(1) != xt.GetLength(1)) throw new InvalidOperationException(); 110 int rows = x.GetLength(0); 111 int cols = xt.GetLength(0); 112 k = new double[rows, cols]; 113 if (symmetric) { 114 for (int i = 0; i < rows; i++) { 115 for (int j = i; j < cols; j++) { 116 117 k[i, j] = Util.ScalarProd(Util.GetRow(x, i).Select((e, k) => e / l[k]), 118 Util.GetRow(x, j).Select((e, k) => e / l[k])); 119 k[j, i] = k[i, j]; 120 } 121 } 122 } else { 123 for (int i = 0; i < rows; i++) { 124 for (int j = 0; j < cols; j++) { 125 k[i, j] = Util.ScalarProd(Util.GetRow(x, i).Select((e, k) => e / l[k]), 126 Util.GetRow(xt, j).Select((e, k) => e / l[k])); 127 } 128 } 129 } 77 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) { 78 return Util.ScalarProd(x, i, xt, j, inverseLength); 130 79 } 131 80 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/ICovarianceFunction.cs
r8484 r8562 30 30 IEnumerable<double> GetGradient(double[,] x, int i, int j); 31 31 double GetCrossCovariance(double[,] x, double[,] xt, int i, int j); 32 //void SetData(double[,] x);33 //void SetData(double[,] x, double[,] xt);34 35 //double GetCovariance(int i, int j);36 //double GetGradient(int i, int j, int k);37 32 } 38 33 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/Util.cs
r8491 r8562 29 29 } 30 30 31 public static double SqrDist(IEnumerable<double> x, IEnumerable<double> y) { 32 return x.Zip(y, (a, b) => (a - b) * (a - b)).Sum(); 33 } 34 31 35 public static double SqrDist(double x, double y) { 32 36 double d = x - y; 33 37 return d * d; 34 }35 36 public static double SqrDist(IEnumerable<double> x, IEnumerable<double> y) {37 return x.Zip(y, (a, b) => (a - b) * (a - b)).Sum();38 38 } 39 39 … … 50 50 return scale * scale * ss; 51 51 } 52 52 53 public static double SqrDist(double[,] x, int i, int j, double[] scale) { 53 54 return SqrDist(x, i, x, j, scale); … … 62 63 return ss; 63 64 } 65 public static double ScalarProd(double[,] x, int i, int j, double scale = 1.0) { 66 return ScalarProd(x, i, x, j, scale); 67 } 68 69 public static double ScalarProd(double[,] x, int i, double[,] xt, int j, double scale = 1.0) { 70 double sum = 0.0; 71 for (int k = 0; k < x.GetLength(1); k++) { 72 sum += x[i, k] * xt[j, k]; 73 } 74 return scale * scale * sum; 75 } 76 public static double ScalarProd(double[,] x, int i, int j, double[] scale) { 77 return ScalarProd(x, i, x, j, scale); 78 } 79 80 public static double ScalarProd(double[,] x, int i, double[,] xt, int j, double[] scale) { 81 double sum = 0.0; 82 for (int k = 0; k < x.GetLength(1); k++) { 83 sum += x[i, k] * scale[k] * xt[j, k] * scale[k]; 84 } 85 return sum; 86 } 64 87 65 88 public static IEnumerable<double> GetRow(double[,] x, int r) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r8473 r8562 120 120 </Compile> 121 121 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 122 <Compile Include="GaussianProcess\CovarianceMaternIso.cs" /> 123 <Compile Include="GaussianProcess\CovarianceLinearArd.cs" /> 122 124 <Compile Include="GaussianProcess\CovarianceRQiso.cs" /> 123 125 <Compile Include="GaussianProcess\CovarianceNoise.cs" /> -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/GaussianProcessFunctionsTest.cs
r8491 r8562 366 366 } 367 367 368 [TestMethod] 369 public void CovMaternIsoTest() { 370 var cov = new CovarianceMaternIso(); 371 cov.D = 1; 372 TestCovarianceFunction(cov, 0, 373 new double[,] 374 { 375 { 0.3504, 0.3297, 0.5736, 0.3413, 0.4721, 0.3071, 0.4052, 0.4670, 0.3995, 0.5310}, 376 { 0.3765, 0.4317, 0.4364, 0.3649, 0.4520, 0.3261, 0.4090, 0.5328, 0.4412, 0.5155}, 377 { 0.4891, 0.4695, 0.5618, 0.4200, 0.3432, 0.4996, 0.5545, 0.4036, 0.4729, 0.5468}, 378 { 0.4918, 0.3358, 0.4935, 0.4420, 0.2843, 0.3562, 0.6189, 0.6027, 0.5844, 0.5373}, 379 { 0.6085, 0.3600, 0.4844, 0.6291, 0.2643, 0.2947, 0.5017, 0.6650, 0.6440, 0.5835}, 380 { 0.5959, 0.4556, 0.4312, 0.5456, 0.2990, 0.3593, 0.5907, 0.7278, 0.7318, 0.5848}, 381 { 0.3720, 0.4733, 0.4507, 0.3492, 0.5928, 0.3435, 0.3972, 0.3798, 0.4041, 0.5320}, 382 { 0.3708, 0.3810, 0.5235, 0.3344, 0.4378, 0.3775, 0.4260, 0.3309, 0.3778, 0.4967}, 383 { 0.3884, 0.4261, 0.5860, 0.3704, 0.5063, 0.3631, 0.4172, 0.4196, 0.4088, 0.5645}, 384 { 0.3516, 0.4413, 0.3808, 0.3253, 0.3839, 0.3700, 0.4200, 0.5215, 0.4193, 0.4426}, 385 }, 386 new double[][,] 387 { 388 new double[,] { 389 { 0, 0.3341, 0.3674, 0.3665, 0.3647, 0.3678, 0.3380, 0.3621, 0.3122, 0.3673}, 390 { 0.3341, 0, 0.3655, 0.3678, 0.3593, 0.3512, 0.3535, 0.3632, 0.3441, 0.2724}, 391 { 0.3674, 0.3655, 0, 0.3679, 0.3657, 0.3678, 0.3679, 0.3518, 0.3521, 0.3639}, 392 { 0.3665, 0.3678, 0.3679, 0, 0.3532, 0.3217, 0.3675, 0.3679, 0.3654, 0.3670}, 393 { 0.3647, 0.3593, 0.3657, 0.3532, 0, 0.3143, 0.3661, 0.3627, 0.3645, 0.3657}, 394 { 0.3678, 0.3512, 0.3678, 0.3217, 0.3143, 0, 0.3679, 0.3624, 0.3677, 0.3462}, 395 { 0.3380, 0.3535, 0.3679, 0.3675, 0.3661, 0.3679, 0, 0.3343, 0.3361, 0.3678}, 396 { 0.3621, 0.3632, 0.3518, 0.3679, 0.3627, 0.3624, 0.3343, 0, 0.3534, 0.3480}, 397 { 0.3122, 0.3441, 0.3521, 0.3654, 0.3645, 0.3677, 0.3361, 0.3534, 0, 0.3669}, 398 { 0.3673, 0.2724, 0.3639, 0.3670, 0.3657, 0.3462, 0.3678, 0.3480, 0.3669, 0}, 399 }, 400 new double[,] { 401 { 2.0000, 1.0726, 0.6992, 0.7999, 0.8353, 0.7546, 1.0516, 0.8703, 1.1763, 0.7767}, 402 { 1.0726, 2.0000, 0.6529, 0.7205, 0.9001, 0.9680, 0.9512, 0.6215, 1.0157, 1.3261}, 403 { 0.6992, 0.6529, 2.0000, 0.7399, 0.8171, 0.7524, 0.7427, 0.9637, 0.9614, 0.6307}, 404 { 0.7999, 0.7205, 0.7399, 2.0000, 0.9532, 1.1341, 0.7016, 0.7298, 0.6522, 0.6865}, 405 { 0.8353, 0.9001, 0.8171, 0.9532, 2.0000, 1.1670, 0.6654, 0.6156, 0.8384, 0.8177}, 406 { 0.7546, 0.9680, 0.7524, 1.1341, 1.1670, 2.0000, 0.7414, 0.6121, 0.7152, 1.0027}, 407 { 1.0516, 0.9512, 0.7427, 0.7016, 0.6654, 0.7414, 2.0000, 1.0716, 1.0620, 0.7236}, 408 { 0.8703, 0.6215, 0.9637, 0.7298, 0.6156, 0.6121, 1.0716, 2.0000, 0.9514, 0.5073}, 409 { 1.1763, 1.0157, 0.9614, 0.6522, 0.8384, 0.7152, 1.0620, 0.9514, 2.0000, 0.7911}, 410 { 0.7767, 1.3261, 0.6307, 0.6865, 0.8177, 1.0027, 0.7236, 0.5073, 0.7911, 2.0000}, 411 }, 412 } 413 ); 414 415 cov = new CovarianceMaternIso(); 416 cov.D = 1; 417 TestCovarianceFunction(cov, 1, 418 new double[,] 419 { 420 { 5.0240, 4.9127, 6.0225, 4.9757, 5.6062, 4.7858, 5.2996, 5.5839, 5.2720, 5.8539}, 421 { 5.1587, 5.4247, 5.4464, 5.0993, 5.5171, 4.8930, 5.3181, 5.8612, 5.4683, 5.7906}, 422 { 5.6795, 5.5947, 5.9766, 5.3703, 4.9856, 5.7244, 5.9479, 5.2920, 5.6098, 5.9177}, 423 { 5.6910, 4.9457, 5.6984, 5.4720, 4.6518, 5.0545, 6.1936, 6.1332, 6.0640, 5.8794}, 424 { 6.1550, 5.0740, 5.6595, 6.2308, 4.5290, 4.7142, 5.7333, 6.3593, 6.2847, 6.0607}, 425 { 6.1078, 5.5332, 5.4226, 5.9127, 4.7394, 5.0707, 6.0880, 6.5739, 6.5871, 6.0658}, 426 { 5.1358, 5.6116, 5.5116, 5.0174, 6.0960, 4.9875, 5.2612, 5.1753, 5.2945, 5.8581}, 427 { 5.1296, 5.1809, 5.8235, 4.9384, 5.4528, 5.1635, 5.3983, 4.9192, 5.1652, 5.7119}, 428 { 5.2179, 5.3989, 6.0701, 5.1278, 5.7524, 5.0900, 5.3568, 5.3681, 5.3171, 5.9874}, 429 { 5.0301, 5.4688, 5.1800, 4.8886, 5.1954, 5.1255, 5.3700, 5.8155, 5.3671, 5.4746}, 430 }, 431 new double[][,] 432 { 433 new double[,] { 434 { 0, 1.3467, 1.9408, 1.7781, 1.7213, 1.8512, 1.3793, 1.6654, 1.1869, 1.8156}, 435 { 1.3467, 0, 2.0157, 1.9064, 1.6180, 1.5105, 1.5369, 2.0667, 1.4355, 0.9602}, 436 { 1.9408, 2.0157, 0, 1.8749, 1.7505, 1.8547, 1.8704, 1.5173, 1.5209, 2.0519}, 437 { 1.7781, 1.9064, 1.8749, 0, 1.5338, 1.2516, 1.9369, 1.8912, 2.0170, 1.9613}, 438 { 1.7213, 1.6180, 1.7505, 1.5338, 0, 1.2011, 1.9955, 2.0764, 1.7164, 1.7495}, 439 { 1.8512, 1.5105, 1.8547, 1.2516, 1.2011, 0, 1.8725, 2.0820, 1.9149, 1.4559}, 440 { 1.3793, 1.5369, 1.8704, 1.9369, 1.9955, 1.8725, 0, 1.3483, 1.3632, 1.9013}, 441 { 1.6654, 2.0667, 1.5173, 1.8912, 2.0764, 2.0820, 1.3483, 0, 1.5366, 2.2512}, 442 { 1.1869, 1.4355, 1.5209, 2.0170, 1.7164, 1.9149, 1.3632, 1.5366, 0, 1.7923}, 443 { 1.8156, 0.9602, 2.0519, 1.9613, 1.7495, 1.4559, 1.9013, 2.2512, 1.7923, 0}, 444 }, 445 new double[,] { 446 { 14.7781, 11.7510, 10.0394, 10.5489, 10.7184, 10.3248, 11.6660, 10.8814, 12.1567, 10.4351}, 447 { 11.7510, 14.7781, 9.7898, 10.1506, 11.0167, 11.3155, 11.2432, 9.6139, 11.5176, 12.7049}, 448 { 10.0394, 9.7898, 14.7781, 10.2506, 10.6319, 10.3138, 10.2646, 11.2970, 11.2870, 9.6657}, 449 { 10.5489, 10.1506, 10.2506, 14.7781, 11.2517, 11.9945, 10.0521, 10.1990, 9.7856, 9.9719}, 450 { 10.7184, 11.0167, 10.6319, 11.2517, 14.7781, 12.1214, 9.8583, 9.5798, 10.7329, 10.6348}, 451 { 10.3248, 11.3155, 10.3138, 11.9945, 12.1214, 14.7781, 10.2581, 9.5600, 10.1233, 11.4631}, 452 { 11.6660, 11.2432, 10.2646, 10.0521, 9.8583, 10.2581, 14.7781, 11.7468, 11.7082, 10.1669}, 453 { 10.8814, 9.6139, 11.2970, 10.1990, 9.5798, 9.5600, 11.7468, 14.7781, 11.2438, 8.9219}, 454 { 12.1567, 11.5176, 11.2870, 9.7856, 10.7329, 10.1233, 11.7082, 11.2438, 14.7781, 10.5061}, 455 { 10.4351, 12.7049, 9.6657, 9.9719, 10.6348, 11.4631, 10.1669, 8.9219, 10.5061, 14.7781}, 456 }, 457 } 458 ); 459 460 cov = new CovarianceMaternIso(); 461 cov.D = 5; 462 TestCovarianceFunction(cov, 0, 463 new double[,] 464 { 465 { 0.4963, 0.4629, 0.7958, 0.4817, 0.6753, 0.4255, 0.5810, 0.6685, 0.5725, 0.7486}, 466 { 0.5375, 0.6197, 0.6264, 0.5193, 0.6481, 0.4570, 0.5867, 0.7507, 0.6331, 0.7303}, 467 { 0.6974, 0.6718, 0.7832, 0.6029, 0.4847, 0.7108, 0.7752, 0.5786, 0.6764, 0.7668}, 468 { 0.7008, 0.4727, 0.7030, 0.6342, 0.3873, 0.5056, 0.8402, 0.8250, 0.8069, 0.7559}, 469 { 0.8305, 0.5116, 0.6914, 0.8494, 0.3535, 0.4049, 0.7134, 0.8794, 0.8623, 0.8060}, 470 { 0.8184, 0.6530, 0.6190, 0.7654, 0.4121, 0.5105, 0.8132, 0.9232, 0.9256, 0.8074}, 471 { 0.5305, 0.6769, 0.6464, 0.4943, 0.8153, 0.4853, 0.5691, 0.5426, 0.5794, 0.7499}, 472 { 0.5286, 0.5443, 0.7399, 0.4706, 0.6283, 0.5390, 0.6115, 0.4648, 0.5395, 0.7071}, 473 { 0.5557, 0.6117, 0.8085, 0.5280, 0.7191, 0.5164, 0.5987, 0.6022, 0.5864, 0.7862}, 474 { 0.4982, 0.6333, 0.5441, 0.4557, 0.5488, 0.5273, 0.6028, 0.7375, 0.6019, 0.6350}, 475 }, 476 new double[][,] 477 { 478 new double[,] { 479 { 0, 0.3844, 0.5881, 0.5499, 0.5324, 0.5694, 0.3987, 0.5135, 0.3134, 0.5603}, 480 { 0.3844, 0, 0.5987, 0.5817, 0.4964, 0.4543, 0.4650, 0.6029, 0.4230, 0.2154}, 481 { 0.5881, 0.5987, 0, 0.5749, 0.5416, 0.5703, 0.5739, 0.4571, 0.4586, 0.6019}, 482 { 0.5499, 0.5817, 0.5749, 0, 0.4638, 0.3422, 0.5874, 0.5785, 0.5988, 0.5915}, 483 { 0.5324, 0.4964, 0.5416, 0.4638, 0, 0.3197, 0.5963, 0.6034, 0.5308, 0.5413}, 484 { 0.5694, 0.4543, 0.5703, 0.3422, 0.3197, 0, 0.5744, 0.6036, 0.5833, 0.4316}, 485 { 0.3987, 0.4650, 0.5739, 0.5874, 0.5963, 0.5744, 0, 0.3852, 0.3917, 0.5806}, 486 { 0.5135, 0.6029, 0.4571, 0.5785, 0.6034, 0.6036, 0.3852, 0, 0.4649, 0.5937}, 487 { 0.3134, 0.4230, 0.4586, 0.5988, 0.5308, 0.5833, 0.3917, 0.4649, 0, 0.5539}, 488 { 0.5603, 0.2154, 0.6019, 0.5915, 0.5413, 0.4316, 0.5806, 0.5937, 0.5539, 0}, 489 }, 490 new double[,] { 491 { 2.0000, 1.5097, 0.9901, 1.1464, 1.1989, 1.0773, 1.4852, 1.2492, 1.6213, 1.1113}, 492 { 1.5097, 2.0000, 0.9152, 1.0239, 1.2908, 1.3817, 1.3599, 0.8633, 1.4419, 1.7557}, 493 { 0.9901, 0.9152, 2.0000, 1.0545, 1.1721, 1.0739, 1.0588, 1.3761, 1.3731, 0.8785}, 494 { 1.1464, 1.0239, 1.0545, 2.0000, 1.3625, 1.5777, 0.9939, 1.0387, 0.9139, 0.9697}, 495 { 1.1989, 1.2908, 1.1721, 1.3625, 2.0000, 1.6120, 0.9356, 0.8534, 1.2033, 1.1730}, 496 { 1.0773, 1.3817, 1.0739, 1.5777, 1.6120, 2.0000, 1.0568, 0.8477, 1.0156, 1.4258}, 497 { 1.4852, 1.3599, 1.0588, 0.9939, 0.9356, 1.0568, 2.0000, 1.5084, 1.4974, 1.0289}, 498 { 1.2492, 0.8633, 1.3761, 1.0387, 0.8534, 0.8477, 1.5084, 2.0000, 1.3601, 0.6706}, 499 { 1.6213, 1.4419, 1.3731, 0.9139, 1.2033, 1.0156, 1.4974, 1.3601, 2.0000, 1.1332}, 500 { 1.1113, 1.7557, 0.8785, 0.9697, 1.1730, 1.4258, 1.0289, 0.6706, 1.1332, 2.0000}, 501 }, 502 } 503 ); 504 505 cov = new CovarianceMaternIso(); 506 cov.D = 5; 507 TestCovarianceFunction(cov, 1, 508 new double[,] 509 { 510 { 6.5823, 6.4972, 7.1422, 6.5459, 6.9521, 6.3944, 6.7729, 6.9402, 6.7551, 7.0723}, 511 { 6.6790, 6.8501, 6.8629, 6.6372, 6.9035, 6.4817, 6.7847, 7.0756, 6.8757, 7.0436}, 512 { 6.9899, 6.9460, 7.1241, 6.8172, 6.5535, 7.0122, 7.1124, 6.7680, 6.9540, 7.0999}, 513 { 6.9957, 6.5229, 6.9993, 6.8778, 6.2792, 6.6048, 7.2033, 7.1828, 7.1579, 7.0835}, 514 { 7.1904, 6.6190, 6.9797, 7.2154, 6.1675, 6.3337, 7.0164, 7.2536, 7.2321, 7.1567}, 515 { 7.1739, 6.9125, 6.8488, 7.0978, 6.3553, 6.6166, 7.1667, 7.3062, 7.3089, 7.1586}, 516 { 6.6630, 6.9549, 6.9004, 6.5773, 7.1696, 6.5549, 6.7481, 6.6904, 6.7696, 7.0742}, 517 { 6.6587, 6.6943, 7.0587, 6.5173, 6.8667, 6.6823, 6.8343, 6.5023, 6.6835, 7.0060}, 518 { 6.7194, 6.8347, 7.1602, 6.6574, 7.0257, 6.6305, 6.8089, 6.8159, 6.7840, 7.1284}, 519 { 6.5868, 6.8760, 6.6937, 6.4782, 6.7042, 6.6558, 6.8171, 7.0551, 6.8153, 6.8793}, 520 }, 521 new double[][,] 522 { 523 new double[,] { 524 { 0, 0.5862, 1.4459, 1.1551, 1.0644, 1.2798, 0.6204, 0.9803, 0.4359, 1.2178}, 525 { 0.5862, 0, 1.5974, 1.3802, 0.9128, 0.7716, 0.8048, 1.7072, 0.6825, 0.2685}, 526 { 1.4459, 1.5974, 0, 1.3222, 1.1103, 1.2860, 1.3141, 0.7801, 0.7846, 1.6746}, 527 { 1.1551, 1.3802, 1.3222, 0, 0.8009, 0.4933, 1.4383, 1.3520, 1.5999, 1.4863}, 528 { 1.0644, 0.9128, 1.1103, 0.8009, 0, 0.4481, 1.5552, 1.7288, 1.0568, 1.1088}, 529 { 1.2798, 0.7716, 1.2860, 0.4933, 0.4481, 0, 1.3179, 1.7414, 1.3962, 0.7060}, 530 { 0.6204, 0.8048, 1.3141, 1.4383, 1.5552, 1.3179, 0, 0.5878, 0.6033, 1.3707}, 531 { 0.9803, 1.7072, 0.7801, 1.3520, 1.7288, 1.7414, 0.5878, 0, 0.8045, 2.1597}, 532 { 0.4359, 0.6825, 0.7846, 1.5999, 1.0568, 1.3962, 0.6033, 0.8045, 0, 1.1785}, 533 { 1.2178, 0.2685, 1.6746, 1.4863, 1.1088, 0.7060, 1.3707, 2.1597, 1.1785, 0}, 534 }, 535 new double[,] { 536 { 14.7781, 14.1637, 13.1581, 13.5134, 13.6208, 13.3631, 14.1260, 13.7191, 14.3263, 13.4382}, 537 { 14.1637, 14.7781, 12.9663, 13.2398, 13.7972, 13.9577, 13.9203, 12.8239, 14.0574, 14.5034}, 538 { 13.1581, 12.9663, 14.7781, 13.3113, 13.5666, 13.3555, 13.3212, 13.9482, 13.9431, 12.8665}, 539 { 13.5134, 13.2398, 13.3113, 14.7781, 13.9248, 14.2646, 13.1676, 13.2747, 12.9630, 13.1074}, 540 { 13.6208, 13.7972, 13.5666, 13.9248, 14.7781, 14.3133, 13.0201, 12.7957, 13.6298, 13.5685}, 541 { 13.3631, 13.9577, 13.3555, 14.2646, 14.3133, 14.7781, 13.3166, 12.7791, 13.2200, 14.0312}, 542 { 14.1260, 13.9203, 13.3212, 13.1676, 13.0201, 13.3166, 14.7781, 14.1618, 14.1449, 13.2516}, 543 { 13.7191, 12.8239, 13.9482, 13.2747, 12.7957, 12.7791, 14.1618, 14.7781, 13.9207, 12.2062}, 544 { 14.3263, 14.0574, 13.9431, 12.9630, 13.6298, 13.2200, 14.1449, 13.9207, 14.7781, 13.4853}, 545 { 13.4382, 14.5034, 12.8665, 13.1074, 13.5685, 14.0312, 13.2516, 12.2062, 13.4853, 14.7781}, 546 }, 547 } 548 ); 549 550 } 551 368 552 369 553 [TestMethod] … … 388 572 ); 389 573 } 574 575 [TestMethod] 576 public void CovLinearArdTest() { 577 TestCovarianceFunction(new CovarianceLinearArd(), 0, 578 new double[,] 579 { 580 { 0.9089, 0.9972, 1.8813, 0.8618, 2.0022, 1.5168, 1.2612, 1.1009, 0.9506, 1.3851}, 581 { 0.4654, 0.7437, 1.1757, 0.4150, 1.4523, 1.0699, 0.7535, 0.6763, 0.5206, 0.8497}, 582 { 1.3719, 1.4959, 2.0386, 1.2323, 1.8810, 2.1422, 1.6645, 1.1482, 1.2603, 1.5724}, 583 { 0.8471, 0.6576, 1.4267, 0.7465, 1.1331, 1.3215, 1.1946, 0.9029, 0.8677, 1.0329}, 584 { 0.7965, 0.5520, 1.2342, 0.7932, 0.8598, 0.9288, 0.8927, 0.7688, 0.7360, 0.9016}, 585 { 0.5306, 0.5096, 0.8879, 0.4618, 0.7612, 0.8960, 0.7367, 0.5462, 0.5288, 0.6475}, 586 { 0.8779, 1.2411, 1.6264, 0.7940, 2.0553, 1.5512, 1.1513, 0.8304, 0.8693, 1.2945}, 587 { 1.4220, 1.6025, 2.2818, 1.2950, 2.3982, 2.1948, 1.7607, 1.2347, 1.3535, 1.7961}, 588 { 1.0929, 1.3303, 1.9743, 1.0277, 2.1337, 1.7820, 1.3686, 1.0950, 1.0529, 1.5034}, 589 { 0.3405, 0.7064, 0.9979, 0.2372, 1.2538, 1.1478, 0.7212, 0.6071, 0.4222, 0.6815}, 590 }, 591 new double[][,] 592 { 593 new double[,] 594 { 595 { -0.3483, -0.0415, -0.7534, -0.7885, -0.4097, -0.4084, -0.2818, -0.7512, -0.3081, -0.0928}, 596 { -0.0415, -0.0049, -0.0897, -0.0939, -0.0488, -0.0486, -0.0336, -0.0895, -0.0367, -0.0111}, 597 { -0.7534, -0.0897, -1.6297, -1.7057, -0.8863, -0.8834, -0.6097, -1.6250, -0.6666, -0.2008}, 598 { -0.7885, -0.0939, -1.7057, -1.7853, -0.9276, -0.9246, -0.6381, -1.7008, -0.6976, -0.2101}, 599 { -0.4097, -0.0488, -0.8863, -0.9276, -0.4820, -0.4804, -0.3316, -0.8837, -0.3625, -0.1092}, 600 { -0.4084, -0.0486, -0.8834, -0.9246, -0.4804, -0.4788, -0.3305, -0.8808, -0.3613, -0.1088}, 601 { -0.2818, -0.0336, -0.6097, -0.6381, -0.3316, -0.3305, -0.2281, -0.6079, -0.2494, -0.0751}, 602 { -0.7512, -0.0895, -1.6250, -1.7008, -0.8837, -0.8808, -0.6079, -1.6204, -0.6646, -0.2002}, 603 { -0.3081, -0.0367, -0.6666, -0.6976, -0.3625, -0.3613, -0.2494, -0.6646, -0.2726, -0.0821}, 604 { -0.0928, -0.0111, -0.2008, -0.2101, -0.1092, -0.1088, -0.0751, -0.2002, -0.0821, -0.0247}, 605 }, 606 new double[,] 607 { 608 { -1.2177, -0.6082, -0.3772, -0.6303, -0.1506, -0.2060, -1.4702, -1.4921, -0.8977, -0.0933}, 609 { -0.6082, -0.3037, -0.1884, -0.3148, -0.0752, -0.1029, -0.7343, -0.7452, -0.4483, -0.0466}, 610 { -0.3772, -0.1884, -0.1168, -0.1952, -0.0466, -0.0638, -0.4554, -0.4622, -0.2781, -0.0289}, 611 { -0.6303, -0.3148, -0.1952, -0.3263, -0.0780, -0.1066, -0.7610, -0.7723, -0.4646, -0.0483}, 612 { -0.1506, -0.0752, -0.0466, -0.0780, -0.0186, -0.0255, -0.1818, -0.1845, -0.1110, -0.0115}, 613 { -0.2060, -0.1029, -0.0638, -0.1066, -0.0255, -0.0348, -0.2487, -0.2524, -0.1519, -0.0158}, 614 { -1.4702, -0.7343, -0.4554, -0.7610, -0.1818, -0.2487, -1.7751, -1.8015, -1.0838, -0.1127}, 615 { -1.4921, -0.7452, -0.4622, -0.7723, -0.1845, -0.2524, -1.8015, -1.8283, -1.0999, -0.1143}, 616 { -0.8977, -0.4483, -0.2781, -0.4646, -0.1110, -0.1519, -1.0838, -1.0999, -0.6617, -0.0688}, 617 { -0.0933, -0.0466, -0.0289, -0.0483, -0.0115, -0.0158, -0.1127, -0.1143, -0.0688, -0.0072}, 618 }, 619 new double[,] 620 { 621 { -0.1103, -0.1659, -0.3856, -0.0072, -0.0202, -0.0794, -0.3048, -0.3436, -0.3042, -0.2117}, 622 { -0.1659, -0.2495, -0.5801, -0.0109, -0.0304, -0.1194, -0.4585, -0.5169, -0.4575, -0.3185}, 623 { -0.3856, -0.5801, -1.3487, -0.0253, -0.0706, -0.2776, -1.0661, -1.2017, -1.0638, -0.7406}, 624 { -0.0072, -0.0109, -0.0253, -0.0005, -0.0013, -0.0052, -0.0200, -0.0225, -0.0199, -0.0139}, 625 { -0.0202, -0.0304, -0.0706, -0.0013, -0.0037, -0.0145, -0.0558, -0.0629, -0.0557, -0.0388}, 626 { -0.0794, -0.1194, -0.2776, -0.0052, -0.0145, -0.0571, -0.2194, -0.2473, -0.2189, -0.1524}, 627 { -0.3048, -0.4585, -1.0661, -0.0200, -0.0558, -0.2194, -0.8427, -0.9499, -0.8408, -0.5854}, 628 { -0.3436, -0.5169, -1.2017, -0.0225, -0.0629, -0.2473, -0.9499, -1.0708, -0.9478, -0.6598}, 629 { -0.3042, -0.4575, -1.0638, -0.0199, -0.0557, -0.2189, -0.8408, -0.9478, -0.8390, -0.5841}, 630 { -0.2117, -0.3185, -0.7406, -0.0139, -0.0388, -0.1524, -0.5854, -0.6598, -0.5841, -0.4066}, 631 }, 632 new double[,] 633 { 634 { -0.5984, -0.3242, -0.8147, -0.2068, -0.7514, -0.2007, -0.4031, -0.6844, -0.8535, -0.0887}, 635 { -0.3242, -0.1756, -0.4413, -0.1120, -0.4070, -0.1087, -0.2184, -0.3707, -0.4623, -0.0481}, 636 { -0.8147, -0.4413, -1.1092, -0.2815, -1.0229, -0.2733, -0.5488, -0.9318, -1.1620, -0.1208}, 637 { -0.2068, -0.1120, -0.2815, -0.0714, -0.2596, -0.0694, -0.1393, -0.2365, -0.2949, -0.0307}, 638 { -0.7514, -0.4070, -1.0229, -0.2596, -0.9434, -0.2521, -0.5062, -0.8593, -1.0717, -0.1114}, 639 { -0.2007, -0.1087, -0.2733, -0.0694, -0.2521, -0.0673, -0.1352, -0.2296, -0.2863, -0.0298}, 640 { -0.4031, -0.2184, -0.5488, -0.1393, -0.5062, -0.1352, -0.2716, -0.4611, -0.5750, -0.0598}, 641 { -0.6844, -0.3707, -0.9318, -0.2365, -0.8593, -0.2296, -0.4611, -0.7828, -0.9762, -0.1015}, 642 { -0.8535, -0.4623, -1.1620, -0.2949, -1.0717, -0.2863, -0.5750, -0.9762, -1.2174, -0.1265}, 643 { -0.0887, -0.0481, -0.1208, -0.0307, -0.1114, -0.0298, -0.0598, -0.1015, -0.1265, -0.0132}, 644 }, 645 new double[,] 646 { 647 { -1.7276, -1.4419, -0.9049, -0.8103, -0.8305, -0.5694, -0.9452, -0.9495, -1.5198, -1.4774}, 648 { -1.4419, -1.2034, -0.7552, -0.6763, -0.6932, -0.4752, -0.7889, -0.7925, -1.2684, -1.2331}, 649 { -0.9049, -0.7552, -0.4739, -0.4244, -0.4350, -0.2982, -0.4951, -0.4973, -0.7960, -0.7738}, 650 { -0.8103, -0.6763, -0.4244, -0.3800, -0.3895, -0.2670, -0.4433, -0.4453, -0.7128, -0.6929}, 651 { -0.8305, -0.6932, -0.4350, -0.3895, -0.3993, -0.2737, -0.4544, -0.4565, -0.7306, -0.7102}, 652 { -0.5694, -0.4752, -0.2982, -0.2670, -0.2737, -0.1876, -0.3115, -0.3129, -0.5009, -0.4869}, 653 { -0.9452, -0.7889, -0.4951, -0.4433, -0.4544, -0.3115, -0.5171, -0.5195, -0.8315, -0.8083}, 654 { -0.9495, -0.7925, -0.4973, -0.4453, -0.4565, -0.3129, -0.5195, -0.5218, -0.8353, -0.8120}, 655 { -1.5198, -1.2684, -0.7960, -0.7128, -0.7306, -0.5009, -0.8315, -0.8353, -1.3369, -1.2997}, 656 { -1.4774, -1.2331, -0.7738, -0.6929, -0.7102, -0.4869, -0.8083, -0.8120, -1.2997, -1.2634}, 657 }, 658 } 659 ); 660 661 TestCovarianceFunction(new CovarianceLinearArd(), 1, 662 new double[,] 663 { 664 { 0.1230, 0.1350, 0.2546, 0.1166, 0.2710, 0.2053, 0.1707, 0.1490, 0.1287, 0.1875}, 665 { 0.0630, 0.1006, 0.1591, 0.0562, 0.1965, 0.1448, 0.1020, 0.0915, 0.0705, 0.1150}, 666 { 0.1857, 0.2024, 0.2759, 0.1668, 0.2546, 0.2899, 0.2253, 0.1554, 0.1706, 0.2128}, 667 { 0.1146, 0.0890, 0.1931, 0.1010, 0.1533, 0.1788, 0.1617, 0.1222, 0.1174, 0.1398}, 668 { 0.1078, 0.0747, 0.1670, 0.1074, 0.1164, 0.1257, 0.1208, 0.1040, 0.0996, 0.1220}, 669 { 0.0718, 0.0690, 0.1202, 0.0625, 0.1030, 0.1213, 0.0997, 0.0739, 0.0716, 0.0876}, 670 { 0.1188, 0.1680, 0.2201, 0.1075, 0.2781, 0.2099, 0.1558, 0.1124, 0.1176, 0.1752}, 671 { 0.1924, 0.2169, 0.3088, 0.1753, 0.3246, 0.2970, 0.2383, 0.1671, 0.1832, 0.2431}, 672 { 0.1479, 0.1800, 0.2672, 0.1391, 0.2888, 0.2412, 0.1852, 0.1482, 0.1425, 0.2035}, 673 { 0.0461, 0.0956, 0.1351, 0.0321, 0.1697, 0.1553, 0.0976, 0.0822, 0.0571, 0.0922}, 674 }, 675 new double[][,] 676 { 677 new double[,] 678 { 679 { -0.0471, -0.0056, -0.1020, -0.1067, -0.0554, -0.0553, -0.0381, -0.1017, -0.0417, -0.0126}, 680 { -0.0056, -0.0007, -0.0121, -0.0127, -0.0066, -0.0066, -0.0045, -0.0121, -0.0050, -0.0015}, 681 { -0.1020, -0.0121, -0.2206, -0.2308, -0.1199, -0.1196, -0.0825, -0.2199, -0.0902, -0.0272}, 682 { -0.1067, -0.0127, -0.2308, -0.2416, -0.1255, -0.1251, -0.0864, -0.2302, -0.0944, -0.0284}, 683 { -0.0554, -0.0066, -0.1199, -0.1255, -0.0652, -0.0650, -0.0449, -0.1196, -0.0491, -0.0148}, 684 { -0.0553, -0.0066, -0.1196, -0.1251, -0.0650, -0.0648, -0.0447, -0.1192, -0.0489, -0.0147}, 685 { -0.0381, -0.0045, -0.0825, -0.0864, -0.0449, -0.0447, -0.0309, -0.0823, -0.0337, -0.0102}, 686 { -0.1017, -0.0121, -0.2199, -0.2302, -0.1196, -0.1192, -0.0823, -0.2193, -0.0899, -0.0271}, 687 { -0.0417, -0.0050, -0.0902, -0.0944, -0.0491, -0.0489, -0.0337, -0.0899, -0.0369, -0.0111}, 688 { -0.0126, -0.0015, -0.0272, -0.0284, -0.0148, -0.0147, -0.0102, -0.0271, -0.0111, -0.0033}, 689 }, 690 new double[,] 691 { 692 { -0.1648, -0.0823, -0.0510, -0.0853, -0.0204, -0.0279, -0.1990, -0.2019, -0.1215, -0.0126}, 693 { -0.0823, -0.0411, -0.0255, -0.0426, -0.0102, -0.0139, -0.0994, -0.1008, -0.0607, -0.0063}, 694 { -0.0510, -0.0255, -0.0158, -0.0264, -0.0063, -0.0086, -0.0616, -0.0625, -0.0376, -0.0039}, 695 { -0.0853, -0.0426, -0.0264, -0.0442, -0.0105, -0.0144, -0.1030, -0.1045, -0.0629, -0.0065}, 696 { -0.0204, -0.0102, -0.0063, -0.0105, -0.0025, -0.0034, -0.0246, -0.0250, -0.0150, -0.0016}, 697 { -0.0279, -0.0139, -0.0086, -0.0144, -0.0034, -0.0047, -0.0337, -0.0342, -0.0206, -0.0021}, 698 { -0.1990, -0.0994, -0.0616, -0.1030, -0.0246, -0.0337, -0.2402, -0.2438, -0.1467, -0.0152}, 699 { -0.2019, -0.1008, -0.0625, -0.1045, -0.0250, -0.0342, -0.2438, -0.2474, -0.1489, -0.0155}, 700 { -0.1215, -0.0607, -0.0376, -0.0629, -0.0150, -0.0206, -0.1467, -0.1489, -0.0896, -0.0093}, 701 { -0.0126, -0.0063, -0.0039, -0.0065, -0.0016, -0.0021, -0.0152, -0.0155, -0.0093, -0.0010}, 702 }, 703 new double[,] 704 { 705 { -0.0149, -0.0224, -0.0522, -0.0010, -0.0027, -0.0107, -0.0413, -0.0465, -0.0412, -0.0287}, 706 { -0.0224, -0.0338, -0.0785, -0.0015, -0.0041, -0.0162, -0.0621, -0.0700, -0.0619, -0.0431}, 707 { -0.0522, -0.0785, -0.1825, -0.0034, -0.0096, -0.0376, -0.1443, -0.1626, -0.1440, -0.1002}, 708 { -0.0010, -0.0015, -0.0034, -0.0001, -0.0002, -0.0007, -0.0027, -0.0030, -0.0027, -0.0019}, 709 { -0.0027, -0.0041, -0.0096, -0.0002, -0.0005, -0.0020, -0.0076, -0.0085, -0.0075, -0.0052}, 710 { -0.0107, -0.0162, -0.0376, -0.0007, -0.0020, -0.0077, -0.0297, -0.0335, -0.0296, -0.0206}, 711 { -0.0413, -0.0621, -0.1443, -0.0027, -0.0076, -0.0297, -0.1140, -0.1286, -0.1138, -0.0792}, 712 { -0.0465, -0.0700, -0.1626, -0.0030, -0.0085, -0.0335, -0.1286, -0.1449, -0.1283, -0.0893}, 713 { -0.0412, -0.0619, -0.1440, -0.0027, -0.0075, -0.0296, -0.1138, -0.1283, -0.1136, -0.0790}, 714 { -0.0287, -0.0431, -0.1002, -0.0019, -0.0052, -0.0206, -0.0792, -0.0893, -0.0790, -0.0550}, 715 }, 716 new double[,] 717 { 718 { -0.0810, -0.0439, -0.1103, -0.0280, -0.1017, -0.0272, -0.0546, -0.0926, -0.1155, -0.0120}, 719 { -0.0439, -0.0238, -0.0597, -0.0152, -0.0551, -0.0147, -0.0296, -0.0502, -0.0626, -0.0065}, 720 { -0.1103, -0.0597, -0.1501, -0.0381, -0.1384, -0.0370, -0.0743, -0.1261, -0.1573, -0.0163}, 721 { -0.0280, -0.0152, -0.0381, -0.0097, -0.0351, -0.0094, -0.0189, -0.0320, -0.0399, -0.0041}, 722 { -0.1017, -0.0551, -0.1384, -0.0351, -0.1277, -0.0341, -0.0685, -0.1163, -0.1450, -0.0151}, 723 { -0.0272, -0.0147, -0.0370, -0.0094, -0.0341, -0.0091, -0.0183, -0.0311, -0.0388, -0.0040}, 724 { -0.0546, -0.0296, -0.0743, -0.0189, -0.0685, -0.0183, -0.0368, -0.0624, -0.0778, -0.0081}, 725 { -0.0926, -0.0502, -0.1261, -0.0320, -0.1163, -0.0311, -0.0624, -0.1059, -0.1321, -0.0137}, 726 { -0.1155, -0.0626, -0.1573, -0.0399, -0.1450, -0.0388, -0.0778, -0.1321, -0.1648, -0.0171}, 727 { -0.0120, -0.0065, -0.0163, -0.0041, -0.0151, -0.0040, -0.0081, -0.0137, -0.0171, -0.0018}, 728 }, 729 new double[,] 730 { 731 { -0.2338, -0.1951, -0.1225, -0.1097, -0.1124, -0.0771, -0.1279, -0.1285, -0.2057, -0.1999}, 732 { -0.1951, -0.1629, -0.1022, -0.0915, -0.0938, -0.0643, -0.1068, -0.1072, -0.1717, -0.1669}, 733 { -0.1225, -0.1022, -0.0641, -0.0574, -0.0589, -0.0404, -0.0670, -0.0673, -0.1077, -0.1047}, 734 { -0.1097, -0.0915, -0.0574, -0.0514, -0.0527, -0.0361, -0.0600, -0.0603, -0.0965, -0.0938}, 735 { -0.1124, -0.0938, -0.0589, -0.0527, -0.0540, -0.0370, -0.0615, -0.0618, -0.0989, -0.0961}, 736 { -0.0771, -0.0643, -0.0404, -0.0361, -0.0370, -0.0254, -0.0422, -0.0423, -0.0678, -0.0659}, 737 { -0.1279, -0.1068, -0.0670, -0.0600, -0.0615, -0.0422, -0.0700, -0.0703, -0.1125, -0.1094}, 738 { -0.1285, -0.1072, -0.0673, -0.0603, -0.0618, -0.0423, -0.0703, -0.0706, -0.1130, -0.1099}, 739 { -0.2057, -0.1717, -0.1077, -0.0965, -0.0989, -0.0678, -0.1125, -0.1130, -0.1809, -0.1759}, 740 { -0.1999, -0.1669, -0.1047, -0.0938, -0.0961, -0.0659, -0.1094, -0.1099, -0.1759, -0.1710}, 741 }, 742 } 743 ); 744 } 745 390 746 391 747 [TestMethod]
Note: See TracChangeset
for help on using the changeset viewer.