m_modelNormal[i][j][0] = m_minValues[j]+delta_init*m_rr.nextDouble(); m_modelNormal[i][j][1] = delta_init/(2*m_num_clusters); m_modelNormal[i][j][2] = 1.0;
if (delta_init <= 0) { m_modelNormal[i][j][0] = m_minValues[j]; m_modelNormal[i][j][1] = m_minStdDev; m_modelNormal[i][j][2] = 1.0; } else { m_modelNormal[i][j][0] = m_minValues[j]+delta_init*m_rr.nextDouble(); m_modelNormal[i][j][1] = delta_init/(2*m_num_clusters); m_modelNormal[i][j][2] = 1.0; }
  private void EM_Init (Instances inst)    throws Exception {    int i, j, k;    m_weights = new double[inst.numInstances()][m_num_clusters];    m_model = new DiscreteEstimator[m_num_clusters][m_num_attribs];    m_modelNormal = new double[m_num_clusters][m_num_attribs][3];    m_priors = new double[m_num_clusters];    for (i = 0; i < m_num_clusters; i++) {      for (j = 0; j < m_num_attribs; j++) {	if (inst.attribute(j).isNominal()) {	  m_model[i][j] = new DiscreteEstimator(m_theInstances.						attribute(j).numValues()						, true);	  for (k=0; k<m_theInstances.attribute(j).numValues(); k++) {	    m_model[i][j].addValue(k, 10*m_rr.nextDouble());	  }	}	else {	  double delta_init = m_maxValues[j]-m_minValues[j];	  m_modelNormal[i][j][0] = m_minValues[j]+delta_init*m_rr.nextDouble();	  m_modelNormal[i][j][1] = delta_init/(2*m_num_clusters);	  m_modelNormal[i][j][2] = 1.0;	}      }    }        // initially equal priors    for (j = 0; j < m_num_clusters; j++) {      m_priors[j] += 1.0;    }    Utils.normalize(m_priors);  }