public HybridGPMSMarginalEstimate(
      int maxIterationMemory,
      int[] priorSampleCounts,
      double[] priorMeans,
      double[] priorStandardDevs,
      double boundErrorProbability,
      int testSamples,
      NoiseVariance noise,
      int iterationSkips) {

    iteration = -1;
    this.iterationSkips = iterationSkips;

    this.testSamples = testSamples;
    this.maxIterationMemory = maxIterationMemory;
    this.priorSampleCounts = priorSampleCounts;
    this.priorMeans = priorMeans;
    this.priorStandardDevs = priorStandardDevs;
    this.noise = noise;

    boundDist = NormalDist.xnormi(boundErrorProbability);
    currentDomainTVals = new HashMap<MultiballVariableState, Double>();
    memory = new MarginalFunctionMemory(maxIterationMemory);
    xVals = null;
    yVals = null;
    tVals = null;
    predictor = null;
    stateArray = null;
  }
 @Override
 public TrueMarginalFunctionEstimation copy() {
   return new HybridGPMSMarginalEstimate(
       maxIterationMemory,
       priorSampleCounts,
       priorMeans,
       priorStandardDevs,
       NormalDist.normp(boundDist),
       testSamples,
       noise,
       iterationSkips);
 }
 private double expectedGain(double currentBound, double mean, double sd) {
   return (currentBound
       + ((mean - currentBound) * NormalDist.phi(currentBound, mean, sd))
       - (sd * NormalDist.N(currentBound, mean, sd)));
 }