Chapter 9 beta

9.1 try just one time point

beta_em=readRDS("betaEM.rds")


true_beta=melt(betaold)
colnames(true_beta)=c("Topic","Disease","Time","Beta")

est_beta=melt(beta_em)
colnames(est_beta)=c("Topic","Disease","Time","Beta")

topicid=sample(K,1)
ggplot(true_beta[true_beta$Topic%in%topicid,],aes(x=Time,y=Beta,fill=as.factor(Topic),group=as.factor(Topic)))+geom_area()+scale_fill_nejm()

ggplot(est_beta[est_beta$Topic%in%topicid,],aes(x=Time,y=Beta,fill=as.factor(Topic),group=as.factor(Topic)))+geom_area()+scale_fill_nejm()