JoyDivisionMan

95 Reputation

3 Badges

5 years, 151 days

MaplePrimes Activity


These are questions asked by JoyDivisionMan

Hello Friends.

I have used Maple to create a Polynomial Regression model.  The model is called "PRModel."  It works fine.  The independent variable is "X" and the dependent variable is "Y."  Both X and Y are of the vector variety.  The model is as follows:

PRModel:=PolynomialFit(10, X, Y, summarize = true);

I would like an estimate of Y for each value of X.  I would like the estimates of Y to be in a variable called "estY."   I have not been successful with this.  I have tried many different variations of the following, but have not been successful.  

estY := eval(PRModel, X);

Any suggestions as to how I can capture the estimates of Y? 

Thank you.

Hello Friends,

I have a function f(t) which I would like to convolve with itself.  I have no problem doing that typically, but my function contains two elliptic integrals (EllipticE and EllipticK), which clearly complicates matters.

My work in included.  As you can see, the plot on the (0,2) interval is continuous, and the area under the curve sums to unity via numerical integration.

with(Statistics)

f := proc (t) options operator, arrow; piecewise(t <= 0, 0, 0 < t and t < 2, (4/3)*t*((4+t^2)*EllipticE(sqrt(1-4/t^2))-8*EllipticK(sqrt(1-4/t^2)))/Pi^2, 2 <= t, 0) end proc

proc (t) options operator, arrow; piecewise(t <= 0, 0, 0 < t and t < 2, (4/3)*t*((4+t^2)*EllipticE(sqrt(1-4/t^2))-8*EllipticK(sqrt(1-4/t^2)))/Pi^2, 2 <= t, 0) end proc

(1)

plot(f(t), t = 0 .. 2)

 

evalf(int(f(t), t = 0 .. 2))

1.000000000+0.*I

(2)

Download CircleDerivation2.mw

Are there any sort of transformations that I can employ which will permit me to convole this function with itself?  I realize a closed-form solution is probably not likely, but something approaching closed-form would be nice.  Via simulation, I have learned that the self-convolved function will have a continuous boundary on the (0, 2*sqrt(2)) interval.

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

1 2 3 4 Page 1 of 4