public void initializeAtomsForFinite(List<Datum> data,String filename,Random random){
  beta=new double[K];
  dof=new double[K];
  omega=new ArrayList<>(K);
  if (filename != null) {
    try {
      loc=BatchMixtureModel.initializeClustersFromFile(filename,K);
      if (loc.size() < K) {
        loc=BatchMixtureModel.gonzalezInitializeMixtureCenters(loc,data,K,random);
      }
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
      loc=BatchMixtureModel.gonzalezInitializeMixtureCenters(data,K,random);
    }
  }
 else {
    loc=BatchMixtureModel.gonzalezInitializeMixtureCenters(data,K,random);
  }
  log.debug("initialized cluster centers as: {}",loc);
  for (int k=0; k < this.K; k++) {
    beta[k]=baseBeta;
    dof[k]=baseNu;
    omega.add(baseOmega);
  }
}

public void initializeAtomsForFinite ( List < Datum > data , String filename , Random random ) { beta = new double [ K ] ; dof = new double [ K ] ; omega = new ArrayList < > ( K ) ; if ( filename != null ) { try { loc = BatchMixtureModel . initializeClustersFromFile ( filename , K ) ; if ( loc . size ( ) < K ) { loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( loc , data , K , random ) ; } } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( data , K , random ) ; } } else { loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( data , K , random ) ; } log . debug ( "initialized cluster centers as: {}" , loc ) ; for ( int k = 0 ; k < this . K ; k ++ ) { beta [ k ] = baseBeta ; dof [ k ] = baseNu ; omega . add ( baseOmega ) ; } }
initializes atom ( component ) distributions . this method works great with finite mixture model .
