# NOT RUN {
## generate some integer samples
x <- sample(1L:10L,size = 40,replace = TRUE)
obj <- CatDP()
obj2 <- CatDP()
obj3 <- CatDP()
## update CatDP object with sufficient statistics
ss <- sufficientStatistics(obj=obj,x=x)
posterior(obj = obj,ss = ss)
## or, update with x itself
posterior(obj = obj2,ss = x)
## or, update with x itself, one by one
for(xx in x) posterior(obj = obj3,ss = xx)
## obj, obj2, obj3 should be the same:
obj
obj2
obj3
# }
Run the code above in your browser using DataLab