distribution function of the difference of two correlated chi-squared variables I am trying to get the probability distribution function of the difference of two correlated chi-squared variable, $Z=X−Y.$ Given that $f_X(x)$ and $f_Y(y)$ are known, and both variables are chi-squaree distributed. $X$ and $Y$ have the same degree of freedom. lets assume that the mean and variance values for $X$ and $Y$ are $\mu_x, \sigma^2_x$ and $\mu_y$ and $\sigma_y^2,$ respectively. the covariance between $X$ and $Y$ is $\sigma_{xy}.$ So how can I calculate the variance and distribution of $Z$ ($f_Z(z)$). what if $\sigma_y^2= \sigma_x^2$?
 A: Comment. Here are a couple of examples. I hope they will
help clarify the Question, and perhaps help you find an answer.
(1) Suppose $Z_1, \dots, Z_5$ are iid standard normal.
Then $X = Z_1^2 + Z_2^2 + Z_3^2$ and $Y = Z_3^2 + Z_4^2 + Z_5^2$
are both distributed $Chisq(df=3),$ but they are correlated
because of they 'share' $Z_3^2.$ I will show some approximate
quantities using simulation. You should be able to find some or all
of the exact values by analysis.
m = 10^5;  n = 5;  z = rnorm(m*n)
DTA = matrix(z, nrow=m) # each row is std norm samp of 5
DTA2 = DTA^2
x = rowSums(DTA2[ ,1:3]); y = rowSums(DTA2[ ,3:5])
mean(x); mean(y)
## 3.003144  # aprx E(X) = 3
## 2.989661  # aprx E(Y) = 3
var(x); var(y); cov(x,y); cor(x,y)
## 6.013771  # aprx Var(X) = 6
## 5.936772  # aprx Var(Y) = 6
## 1.970101  # aprx Cov(x,Y)
## 0.3297159
mean(x-y); var(x-y)
## 0.01348286  # aprx E(X-Y)
## 8.010341    # aprx V(X-Y)

Below are histograms of the simulated distributions of $X$ and $Y$
along with the exact density of $Chisq(3).$ The third panel shows
the simulated distribution of $X - Y$ along with its density estimator
(roughly, a smoothed histogram).

(2) Now suppose the $Z_i$ are as before, but
$X = Z_1^2 + Z_2^2 + Z_3^2$ and $Y = Z_2^2 + Z_3^2 + Z_4^2,$
so the distributions of $X$ and $Y$ are as in (1), but their
covariance is greater because of the increased 'overlap'.
Notice the change in $Cov(X,Y)$ and in the distribution of $X - Y$
x = rowSums(DTA2[ ,1:3]); y = rowSums(DTA2[ ,2:4])
mean(x); mean(y)
## 3.003144
## 2.994843
var(x); var(y); cov(x,y); cor(x,y)
## 6.013771
## 5.997225
## 3.990319
## 0.6644449
mean(x-y); var(x-y)
## 0.008301117
## 4.030358


(3) At an absurd extreme,, $X \equiv Y \sim Chisq(\nu).$ Then $X - Y \equiv 0$
(degenerate), and $E(X-Y) = Var(X-Y) = 0$.

Finally, because you're trying to visualize joint distributions, here are
plots of the simulated joint distributions in (1) and (2). In each case
the joint distribution is suggested by showing 100,000 realizations of the model.
All four marginals are $Chisq(3).$

