Dirichlet transition probabilities from three normalised gamma draws

Samples one row of a transition matrix for a state with three exits by drawing an independent gamma variable for each destination, with shape equal to that destination's count plus any prior and a scale of one, and dividing each draw by their total. The result is a draw from a Dirichlet distribution, the multivariate generalisation of the beta, and the three probabilities add to one in every iteration. Each component has a beta marginal: the second probability from Dirichlet(90, 24, 6) follows Beta(24, 96).

Signature

p_1 = G_1 / (G_1 + G_2 + G_3); p_2 = G_2 / (G_1 + G_2 + G_3); p_3 = G_3 / (G_1 + G_2 + G_3)
Inputs
InputsDefinitionUnit
G_1Draw from a gamma distribution with shape equal to the count for destination 1 plus any prior, 90 in the article's example, and scale onenone
G_2Draw from a gamma distribution with shape equal to the count for destination 2 plus any prior, 24 in the article's example, and scale onenone
G_3Draw from a gamma distribution with shape equal to the count for destination 3 plus any prior, 6 in the article's example, and scale onenone
Output
p_1Sampled probability of moving to destination 1, staying stable in the article's exampleprobability
p_2Sampled probability of moving to destination 2, progressing in the article's exampleprobability
p_3Sampled probability of moving to destination 3, death in the article's exampleprobability

Function

Beta distribution density, moments and fitting for an uncertain probability

Maps two positive shape parameters, alpha and beta, to a probability density on the unit interval that describes uncertainty about a probability, such as a transition probability in a decision tree or Markov model. The parameters are fitted from event counts, with alpha counting events and beta non-events, or from a reported mean and standard error by the method of moments, and the fitted distribution is sampled in probabilistic sensitivity analysis. The formulae below give the mean and variance, the two fitting routes, the gamma alternative for a utility decrement and the Dirichlet extension for states with three or more exits. Gamma(.) in the density is the gamma function.

Try this function

Implementations

  • Excel

    Dirichlet row from gamma draws in Excel

    Cells named Gamma1, Gamma2 and Gamma3 each hold GAMMA.INV(RAND(), count, 1) with that destination's count plus any prior; the three formulas then return the transition probabilities.

    =Gamma1/(Gamma1+Gamma2+Gamma3); =Gamma2/(Gamma1+Gamma2+Gamma3); =Gamma3/(Gamma1+Gamma2+Gamma3)

Assumptions

  • Independent gamma draws with a common scale for a Dirichlet row

    The three gamma draws are independent and share the same scale. With unequal scales the destinations would be weighted unequally and the result would no longer be a Dirichlet draw.

  • Multinomial counts behind a Dirichlet row

    The shapes come from one sample of patients in the starting state, each counted in exactly one destination over the model cycle. A zero count needs a prior, for example one added to every count, because a gamma shape of zero is invalid.

Worked examples

  • Normalising illustrative gamma draws of 86.4, 25.8 and 5.0

    In the article's illustrative draw for counts of 90, 24 and 6, the gamma draws total 117.2 and give probabilities of about 0.7372, 0.2201 and 0.0427, which add to one.

    G_1 = 86.4; G_2 = 25.8; G_3 = 5.0; p_1 = 0.7372; p_2 = 0.2201; p_3 = 0.0427
  • Gamma means returning the Dirichlet mean proportions

    Substituting the mean of each gamma draw, which equals its shape when the scale is one, returns the Dirichlet means 0.75, 0.20 and 0.05, the observed proportions of 90, 24 and 6 out of 120.

    G_1 = 90; G_2 = 24; G_3 = 6; p_1 = 0.75; p_2 = 0.20; p_3 = 0.05

Common errors

  • Separate beta draws for each exit of a three-exit state

    Independent draws from Beta(90, 30), Beta(24, 96) and Beta(6, 114) add to 1.00 on average, but in the article's illustrative simulation of 200,000 iterations the sum fell outside 0.95 to 1.05 in about 38% of draws, so the cohort is not conserved.

Sources

  • Dirichlet sampling by normalised gamma draws in Bayesian Data Analysis

    Gelman A, Carlin JB, Stern HS, Dunson DB, Vehtari A, Rubin DB. Bayesian Data Analysis. 3rd edition. Boca Raton: Chapman & Hall/CRC; 2013. Appendix A, p. 585, which describes the Dirichlet as the conjugate prior for multinomial parameters and a multivariate generalisation of the beta, gives each component a beta marginal and samples it by drawing independent gamma variables with a common scale and dividing each by their sum; Table A.1, p. 581, for the Dirichlet means.

    View source →

  • Dirichlet distribution for multi-branch probabilities in decision models

    Briggs AH, Ades AE, Price MJ. Probabilistic sensitivity analysis for decision trees with multiple branches: use of the Dirichlet distribution in a Bayesian framework. Medical Decision Making. 2003;23(4):341-350. Abstract, which proposes the Dirichlet, the multivariate equivalent of the beta, for probabilistic probabilities over multiple branches that must sum to 1, illustrates a fully probabilistic transition matrix for a Markov model and shows that a Bayesian approach overcomes zero counts.

    View source →

Canonical Identity

Stable URI · Machine-readable · Resolvable · CC BY 4.0

Dirichlet transition probabilities from three normalised gamma draws | HealthEconomics.wiki