public void MeanProdTest() {
      var prod = new MeanProduct();
      prod.Factors.Add(new MeanConst());
      prod.Factors.Add(new MeanConst());
      TestMeanFunction(prod, 0,
        new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
        new double[][]
          {
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
          }
      );
      prod = new MeanProduct();
      prod.Factors.Add(new MeanConst());
      prod.Factors.Add(new MeanConst());
      TestMeanFunction(prod, 1,
        new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
        new double[][]
          {
            new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
            new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
          }
      );

      prod = new MeanProduct();
      prod.Factors.Add(new MeanZero());
      prod.Factors.Add(new MeanLinear());
      TestMeanFunction(prod, 0,
        new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
        new double[][]
          {
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
          }
      );
      prod = new MeanProduct();
      prod.Factors.Add(new MeanZero());
      prod.Factors.Add(new MeanLinear());
      TestMeanFunction(prod, 1,
        new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
        new double[][]
          {
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
            new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
          }
      );

      prod = new MeanProduct();
      prod.Factors.Add(new MeanConst());
      prod.Factors.Add(new MeanLinear());
      TestMeanFunction(prod, 1,
  new double[] { 1.843574580675791, 2.127929337522181, 3.116568910281474, 1.688566127130978, 3.250517738447450, 2.961262743634280, 2.326019412613392, 1.729286976436201, 1.769654419215176, 2.398170347588917 },
  new double[][]
                {
                  new double[] { 2.9088,    1.8646,    3.1971,    1.9890,    1.7640,    1.2801,    2.8059,    3.7243,    3.1899    ,1.4978 },
                  new double[] { 0.4173,    0.0497,    0.9027,    0.9448,    0.4909,    0.4893,    0.3377,    0.9001,    0.3692    ,0.1112 },
                  new double[] { 0.7803,    0.3897,    0.2417,    0.4039,    0.0965,    0.1320,    0.9421,    0.9561,    0.5752    ,0.0598 },
                  new double[] { 0.2348,    0.3532,    0.8212,    0.0154,    0.0430,    0.1690,    0.6491,    0.7317,    0.6477    ,0.4509 },
                  new double[] { 0.5470,    0.2963,    0.7447,    0.1890,    0.6868,    0.1835,    0.3685,    0.6256,    0.7802    ,0.0811 },
                  new double[] { 0.9294,    0.7757,    0.4868,    0.4359,    0.4468,    0.3063,    0.5085,    0.5108,    0.8176    ,0.7948 }
                }
);
    }
Example #2
0
 private MeanProduct(MeanProduct original, Cloner cloner)
   : base(original, cloner) {
   this.factors = cloner.Clone(original.factors);
   this.numberOfVariables = original.numberOfVariables;
 }
 private MeanProduct(MeanProduct original, Cloner cloner)
     : base(original, cloner)
 {
     this.factors           = cloner.Clone(original.factors);
     this.numberOfVariables = original.numberOfVariables;
 }