public void initializeAtomsForDP(List<Datum> data,String filename,Random random){
  omega=new ArrayList<>(K);
  dof=new double[K];
  beta=new double[K];
  if (filename != null) {
    try {
      loc=BatchMixtureModel.initializeClustersFromFile(filename,K);
      log.debug("loc : {}",loc);
      if (loc.size() < K) {
        loc=BatchMixtureModel.gonzalezInitializeMixtureCenters(loc,data,K,random);
      }
    }
 catch (    FileNotFoundException e) {
      log.debug("failed to initialized from file");
      e.printStackTrace();
      loc=BatchMixtureModel.gonzalezInitializeMixtureCenters(data,K,random);
    }
  }
 else {
    loc=BatchMixtureModel.gonzalezInitializeMixtureCenters(data,K,random);
  }
  for (int i=0; i < K; i++) {
    beta[i]=1;
    dof[i]=baseNu;
    omega.add(0,AlgebraUtils.invertMatrix(baseOmegaInverse));
  }
}

public void initializeAtomsForDP ( List < Datum > data , String filename , Random random ) { omega = new ArrayList < > ( K ) ; dof = new double [ K ] ; beta = new double [ K ] ; if ( filename != null ) { try { loc = BatchMixtureModel . initializeClustersFromFile ( filename , K ) ; log . debug ( "loc : {}" , loc ) ; if ( loc . size ( ) < K ) { loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( loc , data , K , random ) ; } } catch ( FileNotFoundException e ) { log . debug ( "failed to initialized from file" ) ; e . printStackTrace ( ) ; loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( data , K , random ) ; } } else { loc = BatchMixtureModel . gonzalezInitializeMixtureCenters ( data , K , random ) ; } for ( int i = 0 ; i < K ; i ++ ) { beta [ i ] = 1 ; dof [ i ] = baseNu ; omega . add ( 0 , AlgebraUtils . invertMatrix ( baseOmegaInverse ) ) ; } }
initializes atom ( component ) distributions . this method works great with dp mixture model .
