#This does the em algorithm for censored data#
#n obs normal(t0,1), m uncensored values, n-m censored at a#
n<-25;a<-4.5;theta0<-4;nt<-50
#data generated from normal(4,1)
xdata<-c(4.238536, 6.078472, 2.917910, 5.607990, 6.117035, 3.509471, 4.082299, 4.097428,
2.964908, 3.010554, 2.943618, 2.913119, 5.867795, 5.561251, 4.075173, 4.554778, 2.214987,
4.096038, 3.776454, 5.273564, 4.061973, 3.996325, 3.530475, 3.552799, 3.978461)
par(mfrow=c(1,2))
#******************Makes Likelihood picture*************************************
ydata<- sort(xdata*(xdataa));m<- sum(xdataa));
m<- sum(xdata