powered by
dcat(x, prob)
dcat(c(1,2,1),matrix(c(.9,.8,.9,.1,.2,.1),3,2)) }
Run the code above in your browser using DataLab