# How reparameterize Beta distribution?

Consider $$X \sim N(\mu,\sigma)$$; I can reparameterize it by $$X = \epsilon\mu + \sigma; \epsilon \sim N(0,I)$$

But given Beta distribution $$X \sim Beta(\alpha,\beta)$$; is there easy way (closed form transformation) to reparameterize $$X$$ with some very simple random variable (Normal, uniform )

My major goal is to do VAE such that my prior is Beta and my posterior is also Beta; so I'm thinking how to reparameterization trick for Beta. What I want to do, is instead of directly sampling from $$Beta(\alpha,\beta)$$ (because couldn't do backpropagation), I want first generate $$\epsilon \sim \mathcal{Q}$$ some easily sampled distribution, then apply some deterministic function that involves $$\alpha, \beta$$, such that after the transformation it follows $$Beta(\alpha,\beta)$$.

• Why do you want to reparametrize it? – Tim Oct 2 '19 at 18:22
• I edited your question by adding the crucial details that you mentioned in the comments. – Tim Oct 3 '19 at 14:27

There is always the obvious inverse cdf representation: $$X=F_{\alpha,\beta}^{-1}(U)$$ where $$F_{\alpha,\beta}^{-1}(\cdot)$$ is the inverse cdf (quantile function) of the Beta $$\mathcal Be(\alpha,\beta)$$ distribution.

Otherwise, the Wikipedia page lists a large collection of connections with other standard distributions, like the Gamma and the F distributions. For integer valued $$\alpha$$ and $$\beta$$, the Beta $$\mathcal Be(\alpha,\beta)$$ distribution is the distribution of an order statistic of a Uniform sample.

• Hi thanks for the reply; I feel I didn't make the post clear. My major goal is to do VAE such that my prior is Beta and my posterior is also Beta; so I'm thinking how to reparameterization trick for Beta – ElleryL Oct 2 '19 at 19:37
• @ElleryL this is what the answer seems to suggest: that you can generate $\epsilon \sim \mathcal{U}(0, 1)$ and then just pass it through the inverse cumulative distribution function of beta $X = F^{-1}_{\alpha,\beta}(\epsilon)$, that is a deterministic function. – Tim Oct 3 '19 at 14:44
• @Tim; thanks for the help; so I guess the trick would be using Kumaraswamy to approximate the inverse of CDF Beta as mentioned stats.stackexchange.com/questions/51820/…. here as my deterministic function ? – ElleryL Oct 3 '19 at 15:32

If you mean representing every beta-distributed random variable as some simple function of the two parameters $$\alpha,\beta$$ and some "standard beta" random variable, then probably it cannot be done.

One alternative to the simple standard way of parameterizing this family of distributions that has crossed my mind is as follows.

The expected value is $$\mu=\dfrac\alpha{\alpha+\beta}.$$

The variance is $$\dfrac{\frac\alpha{\alpha+\beta} \cdot \frac\beta{\alpha+\beta}}{\alpha+\beta+1} = \dfrac{\mu(1-\mu)}{\alpha+\beta+1} = \dfrac{\mu(1-\mu)}\kappa$$

where the last equality defines $$\kappa.$$

So we have \begin{align} \mu & = \alpha/(\alpha+\beta), \\ \kappa & = \alpha+\beta+1. \\[12pt] \alpha & = (\kappa-1)\mu, \\ \beta & = (\kappa-1)(1-\mu). \end{align} $$\mu$$ is the mean and $$\kappa$$ is the concentration. With $$\mu$$ fixed, $$\kappa$$ is proportional to the reciprocal of the variance.

Postscript: It has occurred to me that what I said in the first paragraph above is mistaken, and I've crossed it out. One can use the beta distribution with $$\alpha=\beta=1,$$ which is the same as the uniform distribution on $$[0,1].$$ If $$X$$ has that distribution, then $$F^{-1}(X)\sim\operatorname{Beta}(\alpha,\beta),$$ where $$F$$ is the c.d.f. of the $$\operatorname{Beta}(\alpha,\beta)$$ distribution.

Postpostscript: The postscript above does not represent an alternative parametrization of the family of beta distributions, since the same pair of parameters still represents the same distribution.

• Hi; thanks for the reply. But I get little confused here. Consider I have $\alpha, \beta$; and I want to a sample from $Beta(\alpha,\beta)$. Instead of directly sample from $Beta(\alpha,\beta)$ (because couldn't do backpropagation), I first generate $\epsilon \sim \mathcal{Q}$ some easily sampled distribution, then apply some deterministic from involves $\alpha, \beta$ such that the transformed follows $Beta(\alpha,\beta)$. But how do I proceed the similar approach here with your parameterization ? – ElleryL Oct 2 '19 at 23:26
• @ElleryL : It has occurred to me that what you ask can be done, but it would not have occurred to me to called it a reparametrization of the beta distribution. I've added a postscript to my answer explaining that. – Michael Hardy Oct 4 '19 at 20:27