# PDF (probability density function) of function of a random variable

If I have $X \sim \mathcal{G}(n, \lambda)$ and $Y=n\tau + X$ where $n, \tau$ are constants, then whats the PDF of $Y$?

My guess is it will become something like:

$$(n\tau + X) \sim \mathcal{G}(n, \lambda)$$

so since $n, \tau$ are constants they do not affect the distribution

$$f(y) = \frac{\lambda^n}{\Gamma(n)} y^{n-1}e^{-\lambda y}$$

Am I correct?

According to here,

If $Y = g(X)$ then $f(y) = f(g^{-1}(y))$

So in this case, $g^{-1}(y) = y - n \tau$ then

$$f(y) = f(g^{-1}(y)) = \frac{\lambda^n}{\Gamma(n)}(y-n\tau)^{n-1}e^{-\lambda(y-n\tau)}$$

Is it correct now?

• Hint: Won't affect it much. But $y$ gets replaced by a close relative. Nov 3, 2013 at 4:06
• @AndréNicolas, ok I updated my answer with an attempt. So I used $f(y)=f(g^{-1}(y))$ Nov 3, 2013 at 9:07
• Yes, fine now. Your random variable is a shifted Gamma. Shift, scaling are usually simple to do. One way to remember is from how the density of a shifted/scaled normal $\mu+\sigma Z$ is obtained from the density of the standard normal. Nov 3, 2013 at 15:31
• @AndréNicolas, in the linked question @Did commented that the understanding that $Y = g(X)$ with $g(X)$ being increasing then $f(y)=f(g^{-1}(y))$ is wrong (in general). What do you make out of it? Is my answer right here just by coincidence? Nov 4, 2013 at 11:38
• Yes, it is very wrong for density, it is fine for cdf and then you need to differentiate. For the function $k+y$ the derivative is $1$, so you get the right thing, but sort of by luck. Nov 4, 2013 at 13:02

If $Y = g(X)$ then $f(y) = f(g^{-1}(y))$
So in this case, $g^{-1}(y) = y - n \tau$ then
$$f(y) = f(g^{-1}(y)) = \frac{\lambda^n}{\Gamma(n)}(y-n\tau)^{n-1}e^{-\lambda(y-n\tau)}$$