# CDF of a transformation of variables with a flat region

I'm new to statistics and I started studying it by myself so I'd like to receive and advice about a reasoning related to a flat region in a transformation.

For the transformation given by ('X' is a random variable while 'x' is an outcome)

$$Y = \left\{ \begin{array}{llll} X-a\text{,}& x \gt a\\ 0\text{,}& -a \lt x \leq a\\ X+a\text{,}& x \leq -a \end{array}\right.$$

the text book I use gives a resulting CDF (F_Y) of

$$F_Y(y) = \left\{ \begin{array}{llll} F_x(y+a)\text{,}& y \gt 0\\ F_x(a)\text{,}& y = 0\\ F_x(y-a)\text{,}& y \lt 0 \end{array}\right.$$

Would the following reasoning be correct regarding the CDF (F_Y) for y = 0?

For y=0, we get

$$F_Y(y) = P( Y \leq y ) \Rightarrow F_Y(0) = P(Y \leq 0) = P( Y \lt 0 ) + P( Y = 0 )$$

According to the transformation given, there is non-zero probability mass concentration at y = 0 given by

$$P( Y = 0 ) = P(-a\leq X \leq a) = P( X \leq a ) - P( X \lt -a )$$

So,

$$\begin{array}{111} F_Y(y=0) = P( Y < 0 ) + P( X \leq a ) - P( X \lt -a ) \end{array}$$

Also according to the transformation,

$$P( Y \lt 0 ) = P( X \lt - a )$$

Hence, $$F_Y(y = 0) = P( X \lt - a ) + P(X \leq a ) - P(X \lt -a ) = F_X(a)$$.

• These formulas make no sense. In the first it looks like we must assume "$x$" means "$X$", but in the second the left hand side refers only to $y$ whereas the right hand side refers to "$x$", which is undefined. Surely a textbook would not get its notation so wrong! Are you sure you have transcribed correctly? – whuber Nov 27 '16 at 18:00
• I'm sorry. "X" is a random variable while "x" is an outcome. – Rodrigo Nov 29 '16 at 19:06
• I suspect there are still typos. For instance, shouldn't $Y$ equal $X-a$ for $X\gt a$ and $X+a$ for $Y\lt -a$? – whuber Dec 2 '16 at 3:25
• @whuber, For sure. There were typos regarding the transformation. An image was added for clarification. Thank you very much. BTW, would my reasoning be correct? – Rodrigo Dec 2 '16 at 17:58

You can visualize the CDF of $Y$, $F_Y$, in terms of (a) a graph of the transformation $\phi:X\to Y$ and (b) a graph of the CDF of $X$, $F_X$.
In this figure the top plot shows the graph of $\phi$ while the second plot shows the CDF.
To see the value of $F_Y$ at some trial value $y$, draw a horizontal line at height $y$ in the upper plot (shown at $y=3/8$). Identify all the $x$ for which the graph of $\phi$ lies on or below that line: these are the values of $X$ corresponding to the event $Y\le y$, written $\phi^{-1}(Y \le y)$. They are shown beneath the red parts of the graph. In the lower plot, the values of $F_X$ at this event cover a portion of the vertical axis between $0$ and $1$ (as marked in black). The total amount of coverage is the probability of $\phi^{-1}(Y \le y)$. It is equal to $F_Y(y)$.
Consider what happens when, as in this example, $y$ is increased slightly so that it suddenly includes a flat portion of the graph of $y$.
Instantaneously, all the probability of $X$ corresponding to that flat portion of the graph of $\phi$ is included within $\phi^{-1}(Y \le y)$.