protected void addPredictionIntervals() {
    int		maxNum;
    int		num;
    int		i;
    int		n;
    FastVector	preds;
    FastVector	atts;
    Instances	data;
    Instance	inst;
    Instance	newInst;
    double[]	values;
    double[][]	predInt;
    
    // determine the maximum number of intervals
    maxNum = 0;
    preds  = m_Evaluation.predictions();
    for (i = 0; i < preds.size(); i++) {
      num = ((NumericPrediction) preds.elementAt(i)).predictionIntervals().length;
      if (num > maxNum)
	maxNum = num;
    }
    
    // create new header
    atts = new FastVector();
    for (i = 0; i < m_PlotInstances.numAttributes(); i++)
      atts.addElement(m_PlotInstances.attribute(i));
    for (i = 0; i < maxNum; i++) {
      atts.addElement(new Attribute("predictionInterval_" + (i+1) + "-lowerBoundary"));
      atts.addElement(new Attribute("predictionInterval_" + (i+1) + "-upperBoundary"));
      atts.addElement(new Attribute("predictionInterval_" + (i+1) + "-width"));
    }
    data = new Instances(m_PlotInstances.relationName(), atts, m_PlotInstances.numInstances());
    data.setClassIndex(m_PlotInstances.classIndex());
    
    // update data
    for (i = 0; i < m_PlotInstances.numInstances(); i++) {
      inst = m_PlotInstances.instance(i);
      // copy old values
      values = new double[data.numAttributes()];
      System.arraycopy(inst.toDoubleArray(), 0, values, 0, inst.numAttributes());
      // add interval data
      predInt = ((NumericPrediction) preds.elementAt(i)).predictionIntervals();
      for (n = 0; n < maxNum; n++) {
	if (n < predInt.length){
	  values[m_PlotInstances.numAttributes() + n*3 + 0] = predInt[n][0];
	  values[m_PlotInstances.numAttributes() + n*3 + 1] = predInt[n][1];
	  values[m_PlotInstances.numAttributes() + n*3 + 2] = predInt[n][1] - predInt[n][0];
	}
	else {
	  values[m_PlotInstances.numAttributes() + n*3 + 0] = Utils.missingValue();
	  values[m_PlotInstances.numAttributes() + n*3 + 1] = Utils.missingValue();
	  values[m_PlotInstances.numAttributes() + n*3 + 2] = Utils.missingValue();
	}
      }
      // create new Instance
      newInst = new DenseInstance(inst.weight(), values);
      data.add(newInst);
    }
    
    m_PlotInstances = data;
  }