x<- sim.punc(theta=c(0,5), ns=c(20,20), omega=c(1,1), vp=c(0.2,0.2))
plot(x)
w<- fitGpunc(x, ng=2, minb=7, pool=TRUE, oshare=TRUE)
print (w$par)
## add lines to show the solution
segments(x$tt[1], w$par[1], x$tt[w$shift.start-1], w$par[1], lty=3, col="red", lwd=5)
segments(x$tt[w$shift.start], w$par[2], x$tt[length(x$tt)], w$par[2], lty=3, col="red", lwd=5)
Run the code above in your browser using DataLab