# NOT RUN {
## generate some integer samples
x <- sample(1L:10L,size = 40,replace = TRUE)
obj <- CatDP()
ss <- sufficientStatistics(obj=obj,x=x)
posterior(obj = obj,ss = ss)
obj2 <- CatDP(objCopy = obj) #create obj2 contains the sames info as obj
obj3 <- CatDP(objCopy = obj) #create obj3 contains the sames info as obj
## discard by samples
posteriorDiscard(obj = obj,ss = x)
## or discard by samples, one by one
for(xx in x) posteriorDiscard(obj = obj2,ss = xx)
## or discard by sufficient statistics
posteriorDiscard(obj = obj3,ss = ss)
## obj, obj2 and obj3 should be the same:
obj
obj2
obj3
# }
Run the code above in your browser using DataLab