3

What is the simplest way to transform a normal$(\mu,\sigma)$ distribution to a beta$(a,b)$ distribution? I'm interested in knowing if there is an exact solution, but also if there are approximations that will achieve this? I'm not interested in a specific -- ie normal$(3,2)$ to beta$(0.5,3)$ -- transformation, but rather, general solutions.

Glen_b
  • 257,508
  • 32
  • 553
  • 939
Charlie
  • 275
  • 3
  • 13
  • The beta distribution is bounded at both ends and the Gaussian distribution is not. How do you expect to handle that issue? – shadowtalker Oct 29 '16 at 22:52
  • Charlie ... Do you know the parameters of the normal you have and of the beta you want? – Glen_b Oct 29 '16 at 22:55
  • 2
    @ssdecontrol to go from $(-\infty,\infty)$ to $(0,1)$ is trivial (there's an infinity of transformations that accomplish that -- the set of cdfs). There are much larger issues. – Glen_b Oct 29 '16 at 22:58
  • I'm interested in general solutions... – Charlie Oct 29 '16 at 22:58
  • 1
    I'm sorry, can you be specific about what you mean by "general solutions"? It's *not clear what problem you're asking us to solve* – Glen_b Oct 29 '16 at 22:59
  • How do I go from normal(mu,sd) to beta(a,b) – Charlie Oct 29 '16 at 23:05
  • @Glen_b that's part of the issue. There's no one way to do this. – shadowtalker Oct 30 '16 at 00:04
  • @Charlie I think adding _why_ you want to do this might help people answer the question. – shadowtalker Oct 30 '16 at 00:05
  • 1
    A general solution involves the CDF of the Normal distribution $F$, the CDF of the Beta distribution $G$, and an *arbitrary* measure-preserving function $t:(0,1)\to(0,1)$: the transformation $x\to F^{-1}(t(G(x))$ does the trick. There are loads of such functions $t$. For instance, you can break the interval $(0,1)$ into $n$ equal-length segments at the values $i/n$, pick any permutation $\sigma$ of $1,2,\ldots,n$, and map $x\in ((i-1)/n,i/n)$ to $x+(\sigma(i)-i)/n$ for each $i$. Because this is so extremely general, we would like to know more specifically what you mean by "transform." – whuber Oct 30 '16 at 15:34
  • Thanks. I wanted to do this because I had a set of parameters in a Bayesian analysis sampled using a normal distribution that I actually needed to be beta distributed according to differing beta parameters, and re-writing the code to avoid the normal prior was impractical. It's since occurred to me that amending the likelihood to cancel out the normal prior is a simpler (equivalent?) option, but the answers and comments here were helpful. I'm sorry it was not obvious at first to me what else needed explaining... – Charlie Nov 01 '16 at 20:25

1 Answers1

6

If you're transforming from $X\sim N(\mu,\sigma^2)$ to $Y\sim \text{Beta}(\alpha,\beta)$, then $Y=F_Y^{-1}[\Phi(\frac{X-\mu}{\sigma})]$ where $F_Y$ is the desired cdf of $Y$ and $\Phi$ is the standard normal cdf will achieve the result and preserve ordering (e.g. if $X_1<X_2$ and you transform $X_i$ to $Y_i$, for $i=1,2$ then $Y_1<Y_2$).

(I think this is effectively a duplicate but I didn't manage to locate the post I was looking for. If I find it this post will probably end up closing)

Glen_b
  • 257,508
  • 32
  • 553
  • 939
  • 1
    Were you thinking of [this](http://stats.stackexchange.com/a/94766/7290)? – gung - Reinstate Monica Oct 30 '16 at 00:50
  • @gung I was thinking of one that specifically treats the inverse-cdf of cdf transformation (i.e. of the type $F^{-1}(G(X))$) in answering the question. There's one in particular I half remember but I haven't turned it up. – Glen_b Oct 30 '16 at 00:52
  • @Glen_b I mentioned it also [here](http://stats.stackexchange.com/questions/136972/transform-sample-to-achieve-target-mean-skewness-etc/136974#136974), but I don't know if this is what you were looking for. – Tim Oct 30 '16 at 10:49
  • @Tim Thanks; it's not as direct an answer to the present question as I was after for a duplicate. I believe there's a closer one. – Glen_b Oct 30 '16 at 11:24