docs: private void gibbs(int K, float alpha, float beta) {
          this.K = K;
          this.alpha = alpha;
          this.beta = beta;
  
          // init sampler statistics
          if (SAMPLE_LAG > 0) {
              thetasum = new float[documents.length][K];
              phisum = new float[K][V];
              numstats = 0;
          }
  
          // initial state of the Markov chain:
          initialState(K);
  
          System.out.println("Sampling " + ITERATIONS
              + " iterations with burn-in of " + BURN_IN + " (B/S="
              + THIN_INTERVAL + ").");
  
          for (int i = 0; i < ITERATIONS; i++) {
  
              // for all z_i
              for (int m = 0; m < z.length; m++) {
                  for (int n = 0; n < z[m].length; n++) {
  
                      // (z_i = z[m][n])
                      // sample from p(z_i|z_-i, w)
                      int topic = sampleFullConditional(m, n);
                      z[m][n] = topic;
                  }
              }
  
              if ((i < BURN_IN) && (i % THIN_INTERVAL == 0)) {
                  System.out.print("B");
                  dispcol++;
              }
              // display progress
              if ((i > BURN_IN) && (i % THIN_INTERVAL == 0)) {
                  System.out.print("S");
                  dispcol++;
              }
              // get statistics after burn-in
              if ((i > BURN_IN) && (SAMPLE_LAG > 0) && (i % SAMPLE_LAG == 0)) {
                  updateParams();
                  System.out.print("|");
                  if (i % THIN_INTERVAL != 0)
                      dispcol++;
              }
              if (dispcol >= 100) {
                  System.out.println();
                  dispcol = 0;
              }
          }
      }