+ Reply to Thread
Results 1 to 3 of 3

Thread: Drawing variates from this density function

  1. #1
    Points: 2,053, Level: 27
    Level completed: 36%, Points required for next Level: 97

    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Drawing variates from this density function




    Hi,

    I have derived the following probability density function, which I would like to draw random variates from as part of a Gibbs sampling step:

    f(x) = \frac {1}{\pi\textrm{I}_0(C)}\exp(C\cos x) for 0\leq x\leq\pi (and 0 if x is outside this range),

    where C>0 is a real-valued constant and \textrm{I}_0 is a modified Bessel function of the first kind.

    Can anyone recognize this function as being part of a family of commonly-used distributions? Or suggest a fast way of generating random variates from it (i.e. faster than just numerically inverting the cumulative density function)?

    Thanks for any suggestions.

  2. #2
    TS Contributor
    Points: 22,410, Level: 93
    Level completed: 6%, Points required for next Level: 940

    Posts
    3,020
    Thanks
    12
    Thanked 565 Times in 537 Posts

    Re: Drawing variates from this density function

    Have not think of a quick way yet.. but the most general, simple approach would be rejection sampling.

  3. The Following User Says Thank You to BGM For This Useful Post:

    graeme (08-28-2014)

  4. #3
    Points: 2,053, Level: 27
    Level completed: 36%, Points required for next Level: 97

    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Drawing variates from this density function


    Sorry for not replying sooner - after a bit of fiddling around I managed to implement a rejection sampling scheme using a truncated exponential distribution as my 'bounding' distribution. I've verified the results over the range of C I need and it works very well as well as being far faster than my initial approach of numerically inverting the CDF. Thanks for the suggestion.

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats