public GibbsLDA (int K, int V, float alpha, float beta, int iter, int data [][]) {
        this.K = K;
        this.V = V;
        this.alpha = alpha;
        this.beta = beta;
        this.iter = iter;
        this.data = data;
        
        this.M = data.length;
        int N = 0;
        Random random = new Random ();
        zAssign = new int [M][];

        //NWZ,NMZ,NZ,NM
        NWZ = new int [V][K];
        NMZ = new int [M][K];
        NZ = new int [K];
        NM = new int [M];
        
        for (int i=0;i<V;++i) {
            for (int j=0;j<K;++j) {
                NWZ [i][j] = 0;
            }
        }

        for (int i=0;i<M;++i) {
            for (int j=0;j<K;++j) {
                NMZ [i][j] = 0;
            }
        }
        
        for (int i=0;i<K;++i) {
            NZ [i] = 0;
        }

        for (int i=0;i<M;++i) {
            NM [i] = 0;
        }

        // Create zAssign and init it
        int z = 0;
        int wordId = 0;

        for (int m=0;m<M;++m) {
            N = data [m].length;
            zAssign [m] = new int [N]; 
            
            for (int n=0;n<N;++n) {
                wordId = data [m][n];
                z = random.nextInt (this.K);
                zAssign [m][n] = z;
                
                NWZ [wordId][z] += 1;
                NMZ [m][z] += 1;
                NZ [z] += 1;
            }
                
            NM [m] += N;
        }

    }