Skip to content

leonsi7/continuous-random-variable-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Variable Generator from a density function

In this repo, I prensent you a tool that can make samples from a random variable given by it's density fuunction. The density function can be whatever you want even thought i has a finite integral il the bounds you give.

I use a tree made recursively by barycentric values of the function. You can see how I do that in main.ipynb.

The you can make your on gif with any function you want in calculator.py. You will get a series of pictures containing the histogram plot, and you can create the gif from it online.

Enjoy your reading ;)