Let $X$ and $Y$ be continuous random variables with densities $f_X (x)$ and $f_Y (y)$. Prove that for $Y = aX + b$, $a\neq 0$, $b\in \mathbb{R}$ $$f_Y(y)=\frac{1}{|a|} f_X\left ( \frac{y-b}{a} \right )$$
I need to do that for two cases $a> 0$ and $a <0$.
Sketch $f_X (x) = \operatorname{tri} (x)$ and $f_Y (y)$ for $a = 2$ and $b = 3$. How do the parameters $a$ and $b$ affect the transformed density?
If $a>0$ then $F_Y(y)=P\left (aX+b\leq y\right )=P\left (X\leq\frac{y-b}{a} \right )=F_X\left (\frac{y-b}{a} \right )$
If $a<0$ then $F_Y(y)=P\left (aX+b\leq y\right )=P\left (X\geq\frac{y-b}{a} \right ) =1-P\left (X<\frac{y-b}{a} \right )=1-F_X\left (\frac{y-b}{a} \right) +P\left (X=\frac{y-b}{a} \right )$
How do I get this $\frac{1}{|a|} f_x\left( \frac{y-b}{a} \right)$? I have $F_X$. $f_y(y)=F_Y'(y)$?
How do I sketch the triangular function $f_X (x) = \operatorname{tri} (x)$ and $f_Y (y)$ for $a = 2$ and $b = 3$. How do the parameters $a$ and $b$ affect the transformed density?
Firstly, $P\left(X = \frac{y-b}{a}\right)$ is zero since $X$ is a continuous random variable. Secondly, differentiating $y\mapsto F_Y(y)$, one has $$ f_Y(y) = \frac{\text d}{\text d y} F_Y(y) = \left\lbrace \begin{aligned} \phantom{-} \frac{1}{a} f_X\left(\frac{y-b}{a}\right)\quad &\text{if } a>0 \\ -\frac{1}{a} f_X\left(\frac{y-b}{a}\right)\quad &\text{if } a<0 \end{aligned}\right. $$ Therefore, $f_Y(y) = \frac{1}{|a|} f_X\left(\frac{y-b}{a}\right)$.
If $a=2$, then $1/|a|$ divides the amplitude of the probability density function (PDF) $f_X$ by two, and $y/a$ dilates the PDF by a factor two along the abscissas (so that the integral of the PDF is kept equal to one). Moreover, if $b=3$, the $-b/a$ translates the PDF to the right by three units along the abscissas. In the case of the triangular distribution $f_X(x) = \text{tri}(x)$, we obtain the following graph of PDFs: