Why are r.v $X$, $Y$ independent given that their joint pdf factors as follows: $f(x, y) = k(x) g(y)$? I am currently trying to wrap my head around why given the r.v. $X$, $Y$ and their joint pdf $f(x, y) = k(x) g(y)$ we can say that the r.v. are independent.
I can see that the marginal distribution function of X is
$f_X(x) = k(x) \int^{\infty}_{-\infty} g(y) dy$. However, I am not sure if and why we can say that $\int^{\infty}_{-\infty} g(y) dy$ is 1.
 A: as f(x,y) is a joint pdf, its integral must add up to one, therefore.... the product of the integral of k and the integral of g must be 1, but from the given assumptions you cannot say that either integral has any specific value, as long as their product is 1. For statistical independence of X and Y, you only need to prove that f_X is independent of the value of y and vice versa, which is implied by f_X(x) = k(x) * any constant.
A: The value $\int^{\infty}_{-\infty} g(y) \mathrm dy$ is not $1$ in general, as $g$ is not the marginal density in general. But if $\int^{\infty}_{-\infty} g(y) \mathrm dy\neq 1$ simply choose
$$ \tilde{k}(x):=k(x) \int^{\infty}_{-\infty} g(y) \mathrm dy$$
and
$$ \tilde{g}(x):=\frac{g(x)}{\int^{\infty}_{-\infty} g(y) \mathrm dy} .$$
As $\int^{\infty}_{-\infty} \tilde{k}(x) \mathrm dx=\int^{\infty}_{-\infty}k(x) \int^{\infty}_{-\infty} g(y) \mathrm dy\mathrm dx=\int^{\infty}_{-\infty} f(x,y) \mathrm d(x,y)=1$, these are your marginal densities. Note: the equation
$$f(x, y) = \tilde{k}(x) \tilde{g}(y)$$ is still true. And as you correctly showed $f_X(x)=k(x) \int^{\infty}_{-\infty} g(y) \mathrm dy=\tilde{k}(x)$. This brings you to
$$f(x, y) =f_X(x)f_Y(y).$$
A: To build on the example given above, the goal is to show that:
$f_{X,Y}(x,y) = k(x)g(y) \implies f_{X,Y}(x,y) =  f_X(x)f_Y(y)$
Start with this equality:
$\int\int f(x,y) dydx= 1$
If $f$ factorizes cleanly into $k(x)$ and $g(y)$, we can write:
$\int \int k(x) g(y) dydx = 1$
$\int k(x)dx \int g(y) dy = 1$
Assuming $\int k(x)dx \neq 0$, we can write:
$\int g(y) dy = \frac{1}{\int k(x)dx }$
In order to get the PDF of $Y$ on the left hand side, multiply both sides by $k(x)$
$k(x) \int g(y) dy = \frac{k(x)}{\int k(x)dx }$
$f_Y(y) = \frac{k(x)}{\int k(x)dx }$
In order to get the PDF of $X$ on the right hand side, multiply by $1$ written sneakily as $\frac{g(y)}{g(y)}$
$f_Y(y) = \frac{k(x)g(y)}{g(y)\int k(x)dx }$
Notice that the numerator is the original joint distribution. So we can write:
$f_Y(y) = \frac{f(x,y)}{f_X(x) }$
And therefore
$f_Y(y)f_X(x) = f(x,y)$
$\square$
