Skip to content
MthwRobinson edited this page Dec 21, 2014 · 1 revision

Transformations of Random Variables

Transform

This algorithm is used to transform a random variable X by a function gX. The transformation gX is entered using a list-of-lists data structure, where the first list of the transformation functions and the second is a support list for the transformation. Several special issues dictate how the user should input the transformation. The first is that the transformation functions must be monotonic along each segment of the transformation. If they are not (for example in the case of x -> x**2), local maxima and minima must be included in the support of the transformation. For instance, g(x)=x^2 would be input as [[x**2,x**2],[-oo,0,oo]]. The minimum point at zero is included in the support. User must also be sure to include any non-differentiable points in the support of the transformation. The support of the transformation may 'overshoot' the support of the random variable, as the algorithm will automatically disregard any segment that does not apply.

Syntax

Transform(X,gX)

Examples

In [6]: X=TriangularRV(Rational(2),Rational(4),Rational(5))

In [7]: gX=[[x**2,x**2],[-oo,0,oo]]

In [8]: Y=Transform(X,gX)

In [9]: Y.display()
continuous pdf
for 4 <= x <= 16
---------------------------
1      1- ───────
6       ___
    3⋅╲╱ x 
---------------------------
 
 
for 16 <= x <= 25
---------------------------
  1      5   
-+ ───────
  3       ___
      3⋅╲╱ x 
---------------------------
Clone this wiki locally