# NOT RUN {
tms <- simRHawkes1(par.redist = list(shape = 3, scale = 1),
par.ofdis = list(rate=0.5), branching.ratio = 0.5,
cens = 50)
plot(stepfun(tms,0:length(tms)),do.points=FALSE,vertical=FALSE,xlim=c(0,50))
tms.clust <- simRHawkes1(par.redist = list(shape = 3, scale = 1),
par.ofdis = list(rate=0.5), branching.ratio = 0.5,
cens = 50,flatten=FALSE)
plot(c(0,50),c(0, 1+(nt <-length(it <- tms.clust$immitimes))),
type="n",xlab="time",ylab="cluster")
segments(x0 = it,y0=-0.2,y1=0.2)
for(i in 1:nt)
segments(x0 = c(it[i],it[i]+tms.clust$offspringtimes[[i]]),
y0=i-0.2,y1=i+0.2)
abline(h=0:(nt+1),col="light gray",lty=2)
segments(x0=unlist(lapply(1:nt,function(i)c(it[i],it[i]+tms.clust$offspringtimes[[i]]))),
y0=nt+1-0.2,y1=nt+1+0.2)
# }
Run the code above in your browser using DataLab