### Binomial probabilities
b <- c(0, 0, .30, .70, 1)
A <- matrix(
c(
-1, 1, 0, # p1 >= p2
0, 1, -1, # p2 <= p3
1, 0, 0, # p1 <=.30
0, 1, 0, # p2 <= .70
0, 0, 1
), # p3 <= 1 (redundant)
ncol = 3, byrow = 2
)
Ab_sort(A, b)
### Multinomial probabilities
# prior sampling:
Ab_sort(A, b, options = 4)
# posterior sampling:
Ab_sort(A, b, k = c(10, 3, 2, 14), options = 4)
Run the code above in your browser using DataLab