# NOT RUN {
X <- 1:20
x <- rnorm(20)+ X*0.3
## add information, then remove them
obj <- GaussianNIG(gamma=list(m=0,V=1,a=1,b=1))
ss <- sufficientStatistics(obj = obj,X=X,x=x)
posterior(obj = obj,ss = ss)
obj
posteriorDiscard(obj=obj,ss=ss)
obj
## or, add information, then remove them one by one
obj <- GaussianNIG(gamma=list(m=0,V=1,a=1,b=1))
ssEach <- sufficientStatistics(obj = obj,X=X,x=x,foreach = TRUE)
for(sss in ssEach) posterior(obj = obj,ss = sss)
obj
for(sss in ssEach) posteriorDiscard(obj = obj,ss = sss)
obj
# }
Run the code above in your browser using DataLab