# NOT RUN {
## Generate grouped data
sim = simDegrossData(n=3500, plotting=TRUE, choice=2)
## Create a degrossData object
obj.data = degrossData(Big.bins=sim$Big.bins, freq.j=sim$freq.j, m.j=sim$m.j)
print(obj.data)
## Estimate the density
obj.fit = degross(obj.data)
## Superpose the fitted cdf using the <pdegross> function
with(sim, curve(true.cdf(x),min(Big.bins),max(Big.bins),
col="red",lwd=2, ylab="F(x)"))
curve(pdegross(x,obj.fit),add=TRUE,lty="dashed")
legend("topleft", legend=c("Target cdf","Estimated cdf"), lwd=2,
lty=c("solid","dashed"), col=c("red","black"), box.lty=0, inset=.04)
# }
Run the code above in your browser using DataLab