# Define a distribution from a given distribution

**URL:** <https://discourse.julialang.org/t/define-a-distribution-from-a-given-distribution/48220>\
**Category:** Probabilistic Programming\
**Tags:** distributions\
**Created:** [October 12, 2020, 1:12pm UTC](https://discourse.julialang.org/t/define-a-distribution-from-a-given-distribution/48220 "2020-10-12T13:12:31Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [October 15, 2020, 7:42pm UTC](https://discourse.julialang.org/t/define-a-distribution-from-a-given-distribution/48220/10 "2020-10-15T19:42:41Z")

</div>

@Marco_Antoniotti I have to make an important clarification.

Mathematica can handle transformations of a distribution when it can solve the problem symbolically.  
In Julia things are usually done numerically, not symbolically.  
Eg: Expectations.jl computes expectations numerically using quadrature.

For example consider a transformed Beta[4,3]. Mathematica can do all the following except it has no closed form for the entropy.  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/4/94386d64d497361626c213c1d0c160ca181cbc9e.png)

Now consider a transformed Beta[\alpha, \beta]:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/5/354b0a9cdbe7c7b4db7449f300073f6af75c25ed.png)

I [wrote a cheat-sheet](https://github.com/azev77/QuantEcon.cheatsheet/blob/master/stats-cheatsheet.rst) which shows that Julia handles random variables much better than Matlab/R/STATA.  
If we want Julia to deal w/ general transformations of random variables, we are probably gonna have to do this numerically. (but this means we an handle more transformations than Mathematica)

---

_[View the full topic](https://discourse.julialang.org/t/define-a-distribution-from-a-given-distribution/48220)._
