-
Notifications
You must be signed in to change notification settings - Fork 1
/
pachinko.R
44 lines (31 loc) · 717 Bytes
/
pachinko.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Pachinko allocation
# currently structured gibbs lda
pachinko <- function(i, j, v, nrow, ncol, control, ...){
pachinko.init(...)
phi=
theta=
pachinko.estimate()
for(i in)
#for all z_i
for(m)
for(n)
#z_i =z[m][n]
compute_phi()
if(keep)
inference()
logliks = logliklihood
keepiter++
compute_theta()
if(estimate_phi){
compute_phi()
}
## word assign
for(m) #docs
for(n) #length
wordassign[m][n] = get_wordassign(m,n)
############################################################
pachinko.inference()
return(model)
}
PACHINKO_GIBBS.fit <- function(x, k, control= NULL, model = NULL, call, ...){
}