0
$\begingroup$

Suppose I have a PDF in the form of $$PDF(x;a,b)=\frac{f(x)}{\int\limits_a^b f(x)dx}$$ which is defined for $a\leq x\leq b$ and $f(x)\geq0$.

For example, if $f(x)=x^2+1$ and $a=0,b=2$ and I take any random variable from $0$ to $2$ with given PDF, then clearly $2$ has way more chances to appear than $0$ but I don't know how to quantify that. My goal is to define a function gets a random value for given PDF.

  • 0
    'My goal is to define a function gets a random value for given PDF' - no idea what this means. Maybe give an example? What pdf are you given? What function do you want to define?2017-01-20
  • 1
    check out http://stackoverflow.com/questions/29095070/how-to-simulate-from-an-arbitrary-continuous-probability-distribution2017-01-20

0 Answers 0