# How to actually draw a distribution from a given Dirichlet process?

I am wondering if there's an algorithm to actually draw a distribution from a given Dirichlet process. The closest thing I've came across is the stick-breaking construction of a Dirichlet process, but the problem with that is the stick-breaking construction seems to only end in finite steps with probability 0 (I think one has to basically draw a 1 from a Beta distribution to have it end there) so it'll just run forever almost surely.

I can see that a simple tweak would be to have a cutoff at some point in the stick-breaking construction, i.e if at some point we sampled a $\beta > 1-\epsilon$ for some small $\epsilon$, we just treat it as if we sampled a $\beta = 1$ this time and let the process end. But that seems rather hacky and I am not sure if it'll introduce some undesirable properties for the drawn distribution.

• Hi and welcome. Could you please elaborate on what you mean by "draw a distribution from a given Dirichlet process"? Did you perhaps mean: how to draw a sample from ...? – Jim Jun 18 '18 at 14:07
• Hi Jim, to my understanding a Dirichlet process would yield a (possibly) infinite-dimensional distribution at every draw, instead of a scalar or vector sample. So what I meant was how to actually perform a draw from a DP to obtain such a distribution. Hope this clarifies what I meant. – Tetheras Jun 19 '18 at 5:25