static GaussianProcessCovarianceOptimizationProblem()
        {
            // cumbersome initialization because of ConstrainedValueParameters
            maternIso1 = new CovarianceMaternIso(); SetConstrainedValueParameter(maternIso1.DParameter, 1);
            maternIso3 = new CovarianceMaternIso(); SetConstrainedValueParameter(maternIso3.DParameter, 3);
            maternIso5 = new CovarianceMaternIso(); SetConstrainedValueParameter(maternIso5.DParameter, 5);

            piecewisePoly0 = new CovariancePiecewisePolynomial(); SetConstrainedValueParameter(piecewisePoly0.VParameter, 0);
            piecewisePoly1 = new CovariancePiecewisePolynomial(); SetConstrainedValueParameter(piecewisePoly1.VParameter, 1);
            piecewisePoly2 = new CovariancePiecewisePolynomial(); SetConstrainedValueParameter(piecewisePoly2.VParameter, 2);
            piecewisePoly3 = new CovariancePiecewisePolynomial(); SetConstrainedValueParameter(piecewisePoly3.VParameter, 3);

            poly2 = new CovariancePolynomial(); poly2.DegreeParameter.Value.Value = 2;
            poly3 = new CovariancePolynomial(); poly3.DegreeParameter.Value.Value = 3;

            spectralMixture1 = new CovarianceSpectralMixture(); spectralMixture1.QParameter.Value.Value = 1;
            spectralMixture3 = new CovarianceSpectralMixture(); spectralMixture3.QParameter.Value.Value = 3;
            spectralMixture5 = new CovarianceSpectralMixture(); spectralMixture5.QParameter.Value.Value = 5;

            linear          = new CovarianceLinear();
            linearArd       = new CovarianceLinearArd();
            neuralNetwork   = new CovarianceNeuralNetwork();
            periodic        = new CovariancePeriodic();
            ratQuadraticArd = new CovarianceRationalQuadraticArd();
            ratQuadraticIso = new CovarianceRationalQuadraticIso();
            sqrExpArd       = new CovarianceSquaredExponentialArd();
            sqrExpIso       = new CovarianceSquaredExponentialIso();
        }
    public void CovMaternIsoTest() {
      var cov = new CovarianceMaternIso();
      cov.DParameter.Value = cov.DParameter.ValidValues.Single(x => x.Value == 1);
      TestCovarianceFunction(cov, 0,
        new double[,]
          {
{    0.3504,    0.3297,    0.5736,    0.3413,    0.4721,    0.3071,    0.4052,    0.4670,    0.3995,    0.5310},
{    0.3765,    0.4317,    0.4364,    0.3649,    0.4520,    0.3261,    0.4090,    0.5328,    0.4412,    0.5155},
{    0.4891,    0.4695,    0.5618,    0.4200,    0.3432,    0.4996,    0.5545,    0.4036,    0.4729,    0.5468},
{    0.4918,    0.3358,    0.4935,    0.4420,    0.2843,    0.3562,    0.6189,    0.6027,    0.5844,    0.5373},
{    0.6085,    0.3600,    0.4844,    0.6291,    0.2643,    0.2947,    0.5017,    0.6650,    0.6440,    0.5835},
{    0.5959,    0.4556,    0.4312,    0.5456,    0.2990,    0.3593,    0.5907,    0.7278,    0.7318,    0.5848},
{    0.3720,    0.4733,    0.4507,    0.3492,    0.5928,    0.3435,    0.3972,    0.3798,    0.4041,    0.5320},
{    0.3708,    0.3810,    0.5235,    0.3344,    0.4378,    0.3775,    0.4260,    0.3309,    0.3778,    0.4967},
{    0.3884,    0.4261,    0.5860,    0.3704,    0.5063,    0.3631,    0.4172,    0.4196,    0.4088,    0.5645},
{    0.3516,    0.4413,    0.3808,    0.3253,    0.3839,    0.3700,    0.4200,    0.5215,    0.4193,    0.4426},
          },
        new double[][,]
          {
            new double[,] {
{         0,    0.3341,    0.3674,    0.3665,    0.3647,    0.3678,    0.3380,    0.3621,    0.3122,    0.3673},
{    0.3341,         0,    0.3655,    0.3678,    0.3593,    0.3512,    0.3535,    0.3632,    0.3441,    0.2724},
{    0.3674,    0.3655,         0,    0.3679,    0.3657,    0.3678,    0.3679,    0.3518,    0.3521,    0.3639},
{    0.3665,    0.3678,    0.3679,         0,    0.3532,    0.3217,    0.3675,    0.3679,    0.3654,    0.3670},
{    0.3647,    0.3593,    0.3657,    0.3532,         0,    0.3143,    0.3661,    0.3627,    0.3645,    0.3657},
{    0.3678,    0.3512,    0.3678,    0.3217,    0.3143,         0,    0.3679,    0.3624,    0.3677,    0.3462},
{    0.3380,    0.3535,    0.3679,    0.3675,    0.3661,    0.3679,         0,    0.3343,    0.3361,    0.3678},
{    0.3621,    0.3632,    0.3518,    0.3679,    0.3627,    0.3624,    0.3343,         0,    0.3534,    0.3480},
{    0.3122,    0.3441,    0.3521,    0.3654,    0.3645,    0.3677,    0.3361,    0.3534,         0,    0.3669},
{    0.3673,    0.2724,    0.3639,    0.3670,    0.3657,    0.3462,    0.3678,    0.3480,    0.3669,         0},
            },
            new double[,] {
{    2.0000,    1.0726,    0.6992,    0.7999,    0.8353,    0.7546,    1.0516,    0.8703,    1.1763,    0.7767},
{    1.0726,    2.0000,    0.6529,    0.7205,    0.9001,    0.9680,    0.9512,    0.6215,    1.0157,    1.3261},
{    0.6992,    0.6529,    2.0000,    0.7399,    0.8171,    0.7524,    0.7427,    0.9637,    0.9614,    0.6307},
{    0.7999,    0.7205,    0.7399,    2.0000,    0.9532,    1.1341,    0.7016,    0.7298,    0.6522,    0.6865},
{    0.8353,    0.9001,    0.8171,    0.9532,    2.0000,    1.1670,    0.6654,    0.6156,    0.8384,    0.8177},
{    0.7546,    0.9680,    0.7524,    1.1341,    1.1670,    2.0000,    0.7414,    0.6121,    0.7152,    1.0027},
{    1.0516,    0.9512,    0.7427,    0.7016,    0.6654,    0.7414,    2.0000,    1.0716,    1.0620,    0.7236},
{    0.8703,    0.6215,    0.9637,    0.7298,    0.6156,    0.6121,    1.0716,    2.0000,    0.9514,    0.5073},
{    1.1763,    1.0157,    0.9614,    0.6522,    0.8384,    0.7152,    1.0620,    0.9514,    2.0000,    0.7911},
{    0.7767,    1.3261,    0.6307,    0.6865,    0.8177,    1.0027,    0.7236,    0.5073,    0.7911,    2.0000},
          },
          }
      );

      cov = new CovarianceMaternIso();
      cov.DParameter.Value = cov.DParameter.ValidValues.Single(x => x.Value == 1);
      TestCovarianceFunction(cov, 1,
         new double[,]
           {
{    5.0240,    4.9127,    6.0225,    4.9757,    5.6062,    4.7858,    5.2996,    5.5839,    5.2720,    5.8539},
{    5.1587,    5.4247,    5.4464,    5.0993,    5.5171,    4.8930,    5.3181,    5.8612,    5.4683,    5.7906},
{    5.6795,    5.5947,    5.9766,    5.3703,    4.9856,    5.7244,    5.9479,    5.2920,    5.6098,    5.9177},
{    5.6910,    4.9457,    5.6984,    5.4720,    4.6518,    5.0545,    6.1936,    6.1332,    6.0640,    5.8794},
{    6.1550,    5.0740,    5.6595,    6.2308,    4.5290,    4.7142,    5.7333,    6.3593,    6.2847,    6.0607},
{    6.1078,    5.5332,    5.4226,    5.9127,    4.7394,    5.0707,    6.0880,    6.5739,    6.5871,    6.0658},
{    5.1358,    5.6116,    5.5116,    5.0174,    6.0960,    4.9875,    5.2612,    5.1753,    5.2945,    5.8581},
{    5.1296,    5.1809,    5.8235,    4.9384,    5.4528,    5.1635,    5.3983,    4.9192,    5.1652,    5.7119},
{    5.2179,    5.3989,    6.0701,    5.1278,    5.7524,    5.0900,    5.3568,    5.3681,    5.3171,    5.9874},
{    5.0301,    5.4688,    5.1800,    4.8886,    5.1954,    5.1255,    5.3700,    5.8155,    5.3671,    5.4746},
           },
         new double[][,]
          {
            new double[,] {
{         0,    1.3467,    1.9408,    1.7781,    1.7213,    1.8512,    1.3793,    1.6654,    1.1869,    1.8156},
{    1.3467,         0,    2.0157,    1.9064,    1.6180,    1.5105,    1.5369,    2.0667,    1.4355,    0.9602},
{    1.9408,    2.0157,         0,    1.8749,    1.7505,    1.8547,    1.8704,    1.5173,    1.5209,    2.0519},
{    1.7781,    1.9064,    1.8749,         0,    1.5338,    1.2516,    1.9369,    1.8912,    2.0170,    1.9613},
{    1.7213,    1.6180,    1.7505,    1.5338,         0,    1.2011,    1.9955,    2.0764,    1.7164,    1.7495},
{    1.8512,    1.5105,    1.8547,    1.2516,    1.2011,         0,    1.8725,    2.0820,    1.9149,    1.4559},
{    1.3793,    1.5369,    1.8704,    1.9369,    1.9955,    1.8725,         0,    1.3483,    1.3632,    1.9013},
{    1.6654,    2.0667,    1.5173,    1.8912,    2.0764,    2.0820,    1.3483,         0,    1.5366,    2.2512},
{    1.1869,    1.4355,    1.5209,    2.0170,    1.7164,    1.9149,    1.3632,    1.5366,         0,    1.7923},
{    1.8156,    0.9602,    2.0519,    1.9613,    1.7495,    1.4559,    1.9013,    2.2512,    1.7923,         0},
            },
            new double[,] {
{   14.7781,   11.7510,   10.0394,   10.5489,   10.7184,   10.3248,   11.6660,   10.8814,   12.1567,   10.4351},
{   11.7510,   14.7781,    9.7898,   10.1506,   11.0167,   11.3155,   11.2432,    9.6139,   11.5176,   12.7049},
{   10.0394,    9.7898,   14.7781,   10.2506,   10.6319,   10.3138,   10.2646,   11.2970,   11.2870,    9.6657},
{   10.5489,   10.1506,   10.2506,   14.7781,   11.2517,   11.9945,   10.0521,   10.1990,    9.7856,    9.9719},
{   10.7184,   11.0167,   10.6319,   11.2517,   14.7781,   12.1214,    9.8583,    9.5798,   10.7329,   10.6348},
{   10.3248,   11.3155,   10.3138,   11.9945,   12.1214,   14.7781,   10.2581,    9.5600,   10.1233,   11.4631},
{   11.6660,   11.2432,   10.2646,   10.0521,    9.8583,   10.2581,   14.7781,   11.7468,   11.7082,   10.1669},
{   10.8814,    9.6139,   11.2970,   10.1990,    9.5798,    9.5600,   11.7468,   14.7781,   11.2438,    8.9219},
{   12.1567,   11.5176,   11.2870,    9.7856,   10.7329,   10.1233,   11.7082,   11.2438,   14.7781,   10.5061},
{   10.4351,   12.7049,    9.6657,    9.9719,   10.6348,   11.4631,   10.1669,    8.9219,   10.5061,   14.7781},
            },
          }
       );

      cov = new CovarianceMaternIso();
      cov.DParameter.Value = cov.DParameter.ValidValues.Single(x => x.Value == 5);
      TestCovarianceFunction(cov, 0,
         new double[,]
           {
{    0.4963,    0.4629,    0.7958,    0.4817,    0.6753,    0.4255,    0.5810,    0.6685,    0.5725,    0.7486},
{    0.5375,    0.6197,    0.6264,    0.5193,    0.6481,    0.4570,    0.5867,    0.7507,    0.6331,    0.7303},
{    0.6974,    0.6718,    0.7832,    0.6029,    0.4847,    0.7108,    0.7752,    0.5786,    0.6764,    0.7668},
{    0.7008,    0.4727,    0.7030,    0.6342,    0.3873,    0.5056,    0.8402,    0.8250,    0.8069,    0.7559},
{    0.8305,    0.5116,    0.6914,    0.8494,    0.3535,    0.4049,    0.7134,    0.8794,    0.8623,    0.8060},
{    0.8184,    0.6530,    0.6190,    0.7654,    0.4121,    0.5105,    0.8132,    0.9232,    0.9256,    0.8074},
{    0.5305,    0.6769,    0.6464,    0.4943,    0.8153,    0.4853,    0.5691,    0.5426,    0.5794,    0.7499},
{    0.5286,    0.5443,    0.7399,    0.4706,    0.6283,    0.5390,    0.6115,    0.4648,    0.5395,    0.7071},
{    0.5557,    0.6117,    0.8085,    0.5280,    0.7191,    0.5164,    0.5987,    0.6022,    0.5864,    0.7862},
{    0.4982,    0.6333,    0.5441,    0.4557,    0.5488,    0.5273,    0.6028,    0.7375,    0.6019,    0.6350},
           },
         new double[][,]
          {
            new double[,] {
{         0,    0.3844,    0.5881,    0.5499,    0.5324,    0.5694,    0.3987,    0.5135,    0.3134,    0.5603},
{    0.3844,         0,    0.5987,    0.5817,    0.4964,    0.4543,    0.4650,    0.6029,    0.4230,    0.2154},
{    0.5881,    0.5987,         0,    0.5749,    0.5416,    0.5703,    0.5739,    0.4571,    0.4586,    0.6019},
{    0.5499,    0.5817,    0.5749,         0,    0.4638,    0.3422,    0.5874,    0.5785,    0.5988,    0.5915},
{    0.5324,    0.4964,    0.5416,    0.4638,         0,    0.3197,    0.5963,    0.6034,    0.5308,    0.5413},
{    0.5694,    0.4543,    0.5703,    0.3422,    0.3197,         0,    0.5744,    0.6036,    0.5833,    0.4316},
{    0.3987,    0.4650,    0.5739,    0.5874,    0.5963,    0.5744,         0,    0.3852,    0.3917,    0.5806},
{    0.5135,    0.6029,    0.4571,    0.5785,    0.6034,    0.6036,    0.3852,         0,    0.4649,    0.5937},
{    0.3134,    0.4230,    0.4586,    0.5988,    0.5308,    0.5833,    0.3917,    0.4649,         0,    0.5539},
{    0.5603,    0.2154,    0.6019,    0.5915,    0.5413,    0.4316,    0.5806,    0.5937,    0.5539,         0},
            },
            new double[,] {
{    2.0000,    1.5097,    0.9901,    1.1464,    1.1989,    1.0773,    1.4852,    1.2492,    1.6213,    1.1113},
{    1.5097,    2.0000,    0.9152,    1.0239,    1.2908,    1.3817,    1.3599,    0.8633,    1.4419,    1.7557},
{    0.9901,    0.9152,    2.0000,    1.0545,    1.1721,    1.0739,    1.0588,    1.3761,    1.3731,    0.8785},
{    1.1464,    1.0239,    1.0545,    2.0000,    1.3625,    1.5777,    0.9939,    1.0387,    0.9139,    0.9697},
{    1.1989,    1.2908,    1.1721,    1.3625,    2.0000,    1.6120,    0.9356,    0.8534,    1.2033,    1.1730},
{    1.0773,    1.3817,    1.0739,    1.5777,    1.6120,    2.0000,    1.0568,    0.8477,    1.0156,    1.4258},
{    1.4852,    1.3599,    1.0588,    0.9939,    0.9356,    1.0568,    2.0000,    1.5084,    1.4974,    1.0289},
{    1.2492,    0.8633,    1.3761,    1.0387,    0.8534,    0.8477,    1.5084,    2.0000,    1.3601,    0.6706},
{    1.6213,    1.4419,    1.3731,    0.9139,    1.2033,    1.0156,    1.4974,    1.3601,    2.0000,    1.1332},
{    1.1113,    1.7557,    0.8785,    0.9697,    1.1730,    1.4258,    1.0289,    0.6706,    1.1332,    2.0000},
            },
          }
       );

      cov = new CovarianceMaternIso();
      cov.DParameter.Value = cov.DParameter.ValidValues.Single(x => x.Value == 5);
      TestCovarianceFunction(cov, 1,
         new double[,]
           {
{    6.5823,    6.4972,    7.1422,    6.5459,    6.9521,    6.3944,    6.7729,    6.9402,    6.7551,    7.0723},
{    6.6790,    6.8501,    6.8629,    6.6372,    6.9035,    6.4817,    6.7847,    7.0756,    6.8757,    7.0436},
{    6.9899,    6.9460,    7.1241,    6.8172,    6.5535,    7.0122,    7.1124,    6.7680,    6.9540,    7.0999},
{    6.9957,    6.5229,    6.9993,    6.8778,    6.2792,    6.6048,    7.2033,    7.1828,    7.1579,    7.0835},
{    7.1904,    6.6190,    6.9797,    7.2154,    6.1675,    6.3337,    7.0164,    7.2536,    7.2321,    7.1567},
{    7.1739,    6.9125,    6.8488,    7.0978,    6.3553,    6.6166,    7.1667,    7.3062,    7.3089,    7.1586},
{    6.6630,    6.9549,    6.9004,    6.5773,    7.1696,    6.5549,    6.7481,    6.6904,    6.7696,    7.0742},
{    6.6587,    6.6943,    7.0587,    6.5173,    6.8667,    6.6823,    6.8343,    6.5023,    6.6835,    7.0060},
{    6.7194,    6.8347,    7.1602,    6.6574,    7.0257,    6.6305,    6.8089,    6.8159,    6.7840,    7.1284},
{    6.5868,    6.8760,    6.6937,    6.4782,    6.7042,    6.6558,    6.8171,    7.0551,    6.8153,    6.8793},
           },
         new double[][,]
          {
            new double[,] {
{         0,    0.5862,    1.4459,    1.1551,    1.0644,    1.2798,    0.6204,    0.9803,    0.4359,    1.2178},
{    0.5862,         0,    1.5974,    1.3802,    0.9128,    0.7716,    0.8048,    1.7072,    0.6825,    0.2685},
{    1.4459,    1.5974,         0,    1.3222,    1.1103,    1.2860,    1.3141,    0.7801,    0.7846,    1.6746},
{    1.1551,    1.3802,    1.3222,         0,    0.8009,    0.4933,    1.4383,    1.3520,    1.5999,    1.4863},
{    1.0644,    0.9128,    1.1103,    0.8009,         0,    0.4481,    1.5552,    1.7288,    1.0568,    1.1088},
{    1.2798,    0.7716,    1.2860,    0.4933,    0.4481,         0,    1.3179,    1.7414,    1.3962,    0.7060},
{    0.6204,    0.8048,    1.3141,    1.4383,    1.5552,    1.3179,         0,    0.5878,    0.6033,    1.3707},
{    0.9803,    1.7072,    0.7801,    1.3520,    1.7288,    1.7414,    0.5878,         0,    0.8045,    2.1597},
{    0.4359,    0.6825,    0.7846,    1.5999,    1.0568,    1.3962,    0.6033,    0.8045,         0,    1.1785},
{    1.2178,    0.2685,    1.6746,    1.4863,    1.1088,    0.7060,    1.3707,    2.1597,    1.1785,         0},
            },
            new double[,] {
{   14.7781,   14.1637,   13.1581,   13.5134,   13.6208,   13.3631,   14.1260,   13.7191,   14.3263,   13.4382},
{   14.1637,   14.7781,   12.9663,   13.2398,   13.7972,   13.9577,   13.9203,   12.8239,   14.0574,   14.5034},
{   13.1581,   12.9663,   14.7781,   13.3113,   13.5666,   13.3555,   13.3212,   13.9482,   13.9431,   12.8665},
{   13.5134,   13.2398,   13.3113,   14.7781,   13.9248,   14.2646,   13.1676,   13.2747,   12.9630,   13.1074},
{   13.6208,   13.7972,   13.5666,   13.9248,   14.7781,   14.3133,   13.0201,   12.7957,   13.6298,   13.5685},
{   13.3631,   13.9577,   13.3555,   14.2646,   14.3133,   14.7781,   13.3166,   12.7791,   13.2200,   14.0312},
{   14.1260,   13.9203,   13.3212,   13.1676,   13.0201,   13.3166,   14.7781,   14.1618,   14.1449,   13.2516},
{   13.7191,   12.8239,   13.9482,   13.2747,   12.7957,   12.7791,   14.1618,   14.7781,   13.9207,   12.2062},
{   14.3263,   14.0574,   13.9431,   12.9630,   13.6298,   13.2200,   14.1449,   13.9207,   14.7781,   13.4853},
{   13.4382,   14.5034,   12.8665,   13.1074,   13.5685,   14.0312,   13.2516,   12.2062,   13.4853,   14.7781},
            },
          }
       );

    }
示例#3
0
 private CovarianceMaternIso(CovarianceMaternIso original, Cloner cloner)
   : base(original, cloner) {
 }
示例#4
0
 private CovarianceMaternIso(CovarianceMaternIso original, Cloner cloner)
     : base(original, cloner)
 {
 }