Group Abstract Group Abstract

Message Boards Message Boards

0
|
25 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

I am struggling to find the density function for the absolute difference between two random variable

I have two random variables: x1 and x2. Each random variable has the density function: 2*Sqrt[1-x^2]/Pi. Both random variables are semi-circles on the -1 <= x <= 1 interval. The "area" under each random variable equals unity.

When I try to find the density function of Y = Abs[x1 - x2], I get stuck. Does anyone know of any tricks to find the density function for Y? My code is below.

POSTED BY: Patrick McMullen
2 Replies

A numerical method to calculate the PDF:

pdf[z_] := 
 If[0 < z < 2, 
  8/π^2 NIntegrate[ 
    Sqrt[(1 - x^2) (1 - (x - z)^2)], {x, Max[z - 1, -1], Min[z + 1, 1]}],
   0]

Maybe there's some kind of trig substitution that would make $$ \frac{8}{\pi^2}\int _{\max (-1,z-1)}^{\min (1,z+1)}\sqrt{\left(1-x^2\right) \left(1-(x-z)^2\right)}dx$$ solvable?

POSTED BY: David Trimas

I suppose this is the correct syntax:

dist = ProbabilityDistribution[2*Sqrt[1 - x^2]/Pi, {x, -1, 1}];
trasf = TransformedDistribution[
  Abs[a - b], {a \[Distributed] dist, b \[Distributed] dist}]
NProbability[x > 1, x \[Distributed] trasf]
Plot[NProbability[x > y, x \[Distributed] trasf], {y, 0, 2}]

Unfortunately, it seems that the calculation of the PDF is very slow.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard