3
$\begingroup$

Given a custom pdf $f_x(x)$, I'm trying to find it's transformation $f_y(y)$ where $$y=x^2$$ and $$f_x(x)=30*x^2 (1 - x)^2, 0<x<1$$ I tried to using the following commands:

y = x^2

PDF[TransformedDistribution[y, x \[Distributed] 
         ProbabilityDistribution[30*x^2 (1 - x)^2, {x, 0, 1}]]]

However, the answer comes up in terms of x, not y:

$\text{Function}\left[x, \begin{array}{cc} \{ & \begin{array}{cc} 15. \left(\sqrt{x}-1.\right)^2 \sqrt{x} & 0.\leq x\leq 1.\land 0.<\sqrt{x}<1. \\ 0. & \text{True} \\ \end{array} \\ \end{array} ,\text{Listable}\right]$

Could you please point me in the right direction?

$\endgroup$
2
$\begingroup$

What looks like x is actually \[FormalX] (a dummy argument of the pure function). If you name that function (e.g., pdF= PDF[Transformed....]) you can use it as pdF[z] or pdF[y] etc.

y = x^2;
pdF = PDF[TransformedDistribution[y, 
              x \[Distributed] ProbabilityDistribution[30*x^2 (1 - x)^2, {x, 0, 1}]]]

enter image description here

pdF[z] 

enter image description here

pdF[1/2] // N
(* 0.909903 *)

If you want to use y as the argument, you need to Clear the values and definition of y first:

ClearAll[y];
pdF[y]

enter image description here

Plot[pdF[z], {z, 0, 1}]

enter image description here

Integrate[PiecewiseExpand@pdF[z], {z, 0, 1}]
(* 1 *)
Integrate[PiecewiseExpand@pdF[z], {z, 0, #}] & /@ Range[0, 1, .1]
(* {0, 0.185201, 0.401758, 0.588938, 0.736979, 0.846194, 
    0.920709, 0.966401, 0.990018, 0.998751, 1.} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.