JoyDivisionMan

80 Reputation

3 Badges

5 years, 130 days

MaplePrimes Activity


These are questions asked by JoyDivisionMan

I have created three random variables:  r, theta and phi.  That went as I expected.  I then did some math with these random variable.  I calculated the following:  sin(phi), sin(theta), cos(phi) and cos(theta).

When I viewed the PDFs of these above four, I get what I expected with the exception of sin(theta).  I got an error message telling me that I provided three arguments when Maple expected only two arguments.  I am confused as to why this happened.

I wonder if I broke any rules when I named these variables, but I don't know...any suggestions? My work is attached.

with(Statistics)

theta := RandomVariable(Uniform(0, 2*Pi))

_R

(1)

phi := arccos(-1+2*RandomVariable(Uniform(0, 1)))

arccos(-1+2*_R0)

(2)

r := RandomVariable(Uniform(0, 1))^(1/3)

_R1^(1/3)

(3)

SinPhi := sin(phi)

2*(-_R0^2+_R0)^(1/2)

(4)

PDF(SinPhi, t)

piecewise(t <= 0, 0, t < (1/2)*4^(1/2), t/(-t^2+1)^(1/2), (1/2)*4^(1/2) <= t, 0)

(5)

SinTheta := sin(theta)

sin(_R)

(6)

PDF(SinTheta, t)

Error, (in Statistics:-PDF) invalid input: type expects 2 arguments, but received 3

 

CosPhi := cos(phi)

-1+2*_R0

(7)

PDF(CosPhi, t)

(1/2)*piecewise((1/2)*t < -1/2, 0, (1/2)*t < 1/2, 1, 0)

(8)

CosTheta := cos(theta)

cos(_R)

(9)

PDF(CosTheta, t)

piecewise(t <= -1, 0, t < 1, 1/(Pi*(-t^2+1)^(1/2)), 1 <= t, 0)

(10)
 

NULL

Download Basics.mw

I have the functions dx(t), dt(t), and dz(t).  They are all the same function.  I constructed the dz(t) function as a piecewise function, then copied it to dx(t) and dy(t).  The area under the function curves sum to one as I would expect.

How can I convert these functions into a PDF form so that I can perform mathematical operations on the PDFs, such as add the PDFs to create another PDF?

SphereFinal.mw

I have two random variables:  x and y.  I want to multiply them and get the resulting Probability Density Function, z.  If you look below, Example 1 works as expected.  When I try Example 2, however, I get disappointing results.

Clearly, Example 2 involves nonzero lower boundaries, which is messing me up.  Does anyone have any suggestions for Example 2?

Example 1

with(Statistics)

x := RandomVariable(Uniform(0, 1))

_R

(1)

y := RandomVariable(Uniform(0, 2))

_R0

(2)

z = PDF(x*y, t)

z = piecewise(t < 0, 0, t <= 2, (1/2)*ln(2)-(1/2)*ln(t), 2 < t, 0)

(3)

 

 

Example 2

x := RandomVariable(Uniform(1, 2))

_R1

(4)

y := RandomVariable(Uniform(2, 3))

_R2

(5)

z := PDF(x*y, t)

int(piecewise(_t < 1, 0, _t < 2, 1, 2 <= _t, 0)*piecewise(t/_t < 2, 0, t/_t < 3, 1, 0)/abs(_t), _t = -infinity .. infinity)

(6)
 

NULL

Download MultiplyPDFFunctions.mw

I have a random variable called Y1, which looks like the following: Y1 = 2*sqrt(1 - x^2)/Pi, on the (-1 < x < 1) interval. This "semicircle" integrates to 1, like other random variables. Random variable Y2 is the same as Y1 above. I want to find the random variable Z, which is equal to the absolute difference of two random variables Y1 and Y2. In other words, I want to find Z = |Y1 - Y2|. Via simulation, I know that |Y1 - Y2| takes on a logrithmic form, but I need to get a mathematical solution of this.

I am interested in determining the density function which results from multiplying two random variables.  I have read about the Mellin Transformation, but I just end up confused.  I have two random variables:  f[1], which is nonzero on the 0 < t < 2 interval, and f[2], which is nonzero on the 0 < t < 1 interval.  Of course, both of these random variables sum to one when evaluated.

Any thoughts on how I can obtain the density function for this?  My work is below.

restart

with(Statistics)

f[1] := piecewise(t <= 0, 0, 0 < t and t < 2, 1/(Pi*sqrt(1-(1-t)^2)), t >= 2, 0)

piecewise(t <= 0, 0, 0 < t and t < 2, 1/(Pi*(1-(1-t)^2)^(1/2)), 2 <= t, 0)

f[2] := piecewise(t <= 0, 0, 0 < t and t < 1, 2*t, t >= 1, 0)

piecewise(t <= 0, 0, 0 < t and t < 1, 2*t, 1 <= t, 0)


Download Inquiry.mw

1 2 3 Page 1 of 3