I saw a LDA code which is very efficient, but I don't understand the code.
The code is as follows:

Initialize all the parameters
for iter = 1:ITER
PZ =dirichlet_sample(histc(ZWD,1:K)' +Gamma);
for k = 1:K
PWZ = dirichlet_sample(histc(WordInx(ZWD==k),1:P)' + Beta);
PDZ = dirichlet_sample(histc(DocInx(ZWD==k),1:N)' + Alpha);
PZWD(k,:) = log(PWZ(WordInx)) + log(PDZ(DocInx)) + log(PZ(k));
end
PZWD = exp(PZWD  repmat(max(PZWD), K, 1)) + realmin;
PZWD = PZWD./(repmat(sum(PZWD,1),K,1));
ZWD = randmult(PZWD)';
end

The basic idea:p(zd,w) propto p(wz)*p(dz)*p(z).
I don't understand:
1) What does PZ mean?
2) What is Gamma?
3) What does ZWD mean?
4) What does PZWD mean?
5) Is this the gibbs sampling of LDA? If not, what is it?
Could someone understand the code and help me out? Thanks a lot!
