Results 1 to 2 of 2

Math Help - Transform uniform numbers to numbers governed by probability density function

  1. #1
    Newbie
    Joined
    Apr 2012
    From
    NZ
    Posts
    1

    Transform uniform numbers to numbers governed by probability density function

    Hi there MHF

    I've got this problem which I'm stuck on. I'm generating random uniformly distributed numbers between 0 and 1, and I need to transform these numbers into numbers governed by the probability density function

    Code:
    f(y) = 0.2            for 0 < y ≤ 2
           0.8y - 1.4     for 2 < y ≤ 3
           0              elsewhere
    Apologies for not knowing LaTex, here's a picture .

    I believe the first thing I need to do is figure out the cumulative distribution function F(y), for this I came up with

    Code:
    f(y) = 0.2y                    for 0 < y ≤ 2
           0.4y^2 - 1.4y + 1.6     for 2 < y ≤ 3
           1                       3 < y
    Next I think I need to find the transformation functions for 0 < y ≤ 2 and 2 < y ≤ 3. So by substituting the uniform variable U in I can get y = U / 0.2 for the first segment, however for the second segment (2 < y ≤ 3) I get two quadratics here (wolfram link) so I'm not sure if this is the right track or not.

    Basically my understanding of how transforming these variables works goes like this

    1) Generate uniform random variable U
    2) If U is less than 0.4 (which I got from subbing y=2 into 0.2y), it is transformed using y = U / 0.2. Otherwise if U is greater than 0.4 it is transformed using one of the quadratics in the above link.

    Anyone able to help me out here? Much appreciated
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    May 2010
    Posts
    1,028
    Thanks
    28

    Re: Transform uniform numbers to numbers governed by probability density function

    Edit: error removed

    The CDF is:

    Code:
    F(y) = 0.2y  for 0 < y ≤ 2 
          0.4y^2 - 1.4y + 1.6 for 2 < y ≤ 3 
          1 for  3 < y
    when you solve the quadratic and get two candidate functions for C(u), only one candidate will satisfy the initial conditions C(1)=3 and C(0.4)=2
    Last edited by SpringFan25; April 9th 2012 at 09:01 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: August 29th 2011, 02:18 AM
  2. Replies: 4
    Last Post: October 27th 2010, 05:41 AM
  3. if X is uniform, find density function of Y=X^2
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: May 8th 2010, 02:36 PM
  4. probability density function
    Posted in the Statistics Forum
    Replies: 2
    Last Post: December 5th 2009, 02:35 PM
  5. Probability density function
    Posted in the Calculus Forum
    Replies: 4
    Last Post: May 20th 2009, 01:35 PM

Search Tags


/mathhelpforum @mathhelpforum