sim.cb function

Function to simulate the chain-binomial model