+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 31

Thread: A question about the distribution of random numbers

  1. #1
    Points: 1,023, Level: 17
    Level completed: 23%, Points required for next Level: 77

    Posts
    40
    Thanks
    10
    Thanked 0 Times in 0 Posts

    A question about the distribution of random numbers




    Suppose I have two independent random variables A, and B, which are distributed Normally as follows:

    A: N~(MA,VA)
    B: N~(MB,VB)

    Now consider that I draw many A's and B's and arrange these randomly and pair-wise (A's next to B's).

    Having done that, I then identify all those values of A drawn, which are greater than their partnering value of B. Let us call these identified values C.

    My question is now this: How is C distributed?

  2. #2
    Devorador de queso
    Points: 95,781, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,933
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: A question about the distribution of random numbers

    So it sounds like we could rephrase this as: For A and B as defined previously what is the distribution of (A | A > B)

    Is this correct?
    I don't have emotions and sometimes that makes me very sad.

  3. #3
    Points: 1,023, Level: 17
    Level completed: 23%, Points required for next Level: 77

    Posts
    40
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: A question about the distribution of random numbers

    Dason, that is correct.

  4. #4
    Omega Contributor
    Points: 38,334, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,998
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: A question about the distribution of random numbers

    Lets hope that someone else chimes in, because I am slightly out of my element here, but my inclination would be:

    Bin(0.5,n)

  5. #5
    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: A question about the distribution of random numbers

    I guess it maybe called a "random-truncated normal distribution".

    The cumulative distribution function can be calculated by definition as usual:

    \Pr\{A \leq a|A > B\}
= \frac {\Pr\{A \leq a, A > B\}} {\Pr\{A > B\}}

    Since A \sim \mathcal{N}(\mu_A, \sigma^2_A), B \sim \mathcal{N}(\mu_B, \sigma^2_B) and they are independent,
    we have A - B \sim \mathcal{N}(\mu_A - \mu_B, \sigma^2_A + \sigma^2_B)

    and thus the denominator
    \Pr\{A > B\} = \Pr\{A - B > 0\} 
= \Phi\left(\frac {\mu_A - \mu_B} {\sqrt{\sigma^2_A + \sigma^2_B}}\right)

    For the numerator,
    \Pr\{A \leq a, A > B\} = \int_{-\infty}^a \Pr\{B < x\}f_A(x)dx
    which at least can be computed numerically.

    If you seek the probability density function, by differentiation,

    f_C(a) = 
\Phi\left(\frac {\mu_A - \mu_B} {\sqrt{\sigma^2_A + \sigma^2_B}}\right)^{-1}
\Phi\left(\frac {a - \mu_B} {\sigma_B}\right)\frac {1} {\sigma_A}\phi\left(\frac {a - \mu_A} {\sigma_A}\right)

  6. The Following 3 Users Say Thank You to BGM For This Useful Post:

    BigBugBuzzz (09-18-2012), Dason (09-18-2012), hlsmith (09-18-2012)

  7. #6
    Points: 1,023, Level: 17
    Level completed: 23%, Points required for next Level: 77

    Posts
    40
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: A question about the distribution of random numbers

    Thank you BGM for taking the time. I have a few questions about your solution:

    1) What is a? Dason noted that my problem was to find the distribution of (A | A > B) which doesn't include a.

    2) What is phi?

    3) What is capital phi?

    (Is this a new distribution?!)

    Cheers

  8. #7
    Devorador de queso
    Points: 95,781, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,933
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: A question about the distribution of random numbers

    Quote Originally Posted by BigBugBuzzz View Post
    Thank you BGM for taking the time. I have a few questions about your solution:

    1) What is a? Dason noted that my problem was to find the distribution of (A | A > B) which doesn't include a.

    2) What is phi?

    3) What is capital phi?

    (Is this a new distribution?!)

    Cheers
    a is the value of A under consideration. Since he was specifying a density "a" is the input value for the pdf.

    phi is the density of the standard normal distribution. Capital phi is the CDF of the standard normal distribution. Is the result a new distribution? It doesn't have a name (that I know of) but I'm sure somebody else has thought of it before.
    I don't have emotions and sometimes that makes me very sad.

  9. The Following User Says Thank You to Dason For This Useful Post:

    BigBugBuzzz (09-18-2012)

  10. #8
    Points: 1,023, Level: 17
    Level completed: 23%, Points required for next Level: 77

    Posts
    40
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: A question about the distribution of random numbers

    Okay, that makes more sense. However, then my question is, do phi and PHI have particular means and variances?

    (Oh, perhaps I already know the answer... Mean = muA - muB, and VAR = sig^2A + sig^2B ?)

  11. #9
    Points: 1,023, Level: 17
    Level completed: 23%, Points required for next Level: 77

    Posts
    40
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: A question about the distribution of random numbers

    Looking at the first part of fc(a), if muA and muB are equal, then we get division by zero, no? Can that be right?

  12. #10
    TS Contributor
    Points: 22,399, Level: 93
    Level completed: 5%, Points required for next Level: 951
    spunky's Avatar
    Location
    vancouver, canada
    Posts
    2,135
    Thanks
    166
    Thanked 537 Times in 431 Posts

    Re: A question about the distribution of random numbers

    Quote Originally Posted by BigBugBuzzz View Post
    we get division by zero, no?
    where are you getting a division by 0? where in the expression are you finding \mu_{A}-\mu_{B} to be the divisor?
    for all your psychometric needs! https://psychometroscar.wordpress.com/about/

  13. #11
    Points: 1,023, Level: 17
    Level completed: 23%, Points required for next Level: 77

    Posts
    40
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: A question about the distribution of random numbers

    I am not so sure about BGM's solution. I have tried to examine the result using Mathematica, but I am probably doing something wrong. My Mathematica code is shown below:

    \[Mu]1 = 11
    \[Mu]2 = 10
    \[Mu] = \[Mu]1 - \[Mu]2
    \[Sigma]1 = 1
    \[Sigma]2 = 5
    \[Sigma] = \[Sigma]1 + \[Sigma]2
    \[CapitalEta] = (\[Mu] /(Sqrt[\[Sigma]1^2 + \[Sigma]2^2]))^-1
    \[CapitalRho] = ((x - \[Mu]2)/\[Sigma]2)*(1/\[Sigma]1)
    \[CapitalNu] = ((x - \[Mu]1)/\[Sigma]1 )

    Plot[CDF[NormalDistribution[\[Mu], \[Sigma]], x]*\[CapitalEta]*
    CDF[NormalDistribution[\[Mu], \[Sigma]], x]*\[CapitalRho]*
    PDF[NormalDistribution[\[Mu], \[Sigma]], x]*\[CapitalNu], {x, -100,
    100}]


    Any ideas where I am making a mistake?

  14. #12
    Points: 1,023, Level: 17
    Level completed: 23%, Points required for next Level: 77

    Posts
    40
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: A question about the distribution of random numbers

    if muA and muB are equal, then we get [0/Sqrt(sig^2A+sig^2B)]^-1

    that is, 0^-1 ...

  15. #13
    TS Contributor
    Points: 22,399, Level: 93
    Level completed: 5%, Points required for next Level: 951
    spunky's Avatar
    Location
    vancouver, canada
    Posts
    2,135
    Thanks
    166
    Thanked 537 Times in 431 Posts

    Re: A question about the distribution of random numbers

    Quote Originally Posted by BigBugBuzzz View Post
    if muA and muB are equal, then we get [0/Sqrt(sig^2A+sig^2B)]^-1

    that is, 0^-1 ...
    that exponential to the minus one does not mean division. it's asking you to take the inverse function of the standard normal CDF.
    for all your psychometric needs! https://psychometroscar.wordpress.com/about/

  16. #14
    Devorador de queso
    Points: 95,781, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,933
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: A question about the distribution of random numbers

    Quote Originally Posted by spunky View Post
    that exponential to the minus one does not mean division. it's asking you to take the inverse function of the standard normal CDF.
    No it actually does mean division in this case. But the fact is that you don't get 0. You get \Phi(0)^{-1} = .5^{-1} = 2
    I don't have emotions and sometimes that makes me very sad.

  17. #15
    Super Moderator
    Points: 13,151, Level: 74
    Level completed: 76%, Points required for next Level: 99
    Dragan's Avatar
    Location
    Illinois, US
    Posts
    2,014
    Thanks
    0
    Thanked 223 Times in 192 Posts

    Re: A question about the distribution of random numbers


    Quote Originally Posted by BigBugBuzzz View Post
    I am not so sure about BGM's solution. I have tried to examine the result using Mathematica, but I am probably doing something wrong. My Mathematica code is shown below:

    \[Mu]1 = 11
    \[Mu]2 = 10
    \[Mu] = \[Mu]1 - \[Mu]2
    \[Sigma]1 = 1
    \[Sigma]2 = 5
    \[Sigma] = \[Sigma]1 + \[Sigma]2
    \[CapitalEta] = (\[Mu] /(Sqrt[\[Sigma]1^2 + \[Sigma]2^2]))^-1
    \[CapitalRho] = ((x - \[Mu]2)/\[Sigma]2)*(1/\[Sigma]1)
    \[CapitalNu] = ((x - \[Mu]1)/\[Sigma]1 )

    Plot[CDF[NormalDistribution[\[Mu], \[Sigma]], x]*\[CapitalEta]*
    CDF[NormalDistribution[\[Mu], \[Sigma]], x]*\[CapitalRho]*
    PDF[NormalDistribution[\[Mu], \[Sigma]], x]*\[CapitalNu], {x, -100,
    100}]


    Any ideas where I am making a mistake?

    I believe your original question can be thought of equivalently as the maximum of A,B.

    Therefore take the product of the two CDFs (in one variable, say, X) and then take the derivative of the resulting product with respect to X and that should be your PDF.

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast

           




Tags for this 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