# What is the distribution of $(X−Y)^2+(Z−Y)^2$, where $X$,$Y$ and $Z$ are independent normal distributions with their own means and variance? [duplicate]

I came up with a question: What is the distribution of $$(X−Y)^2+(Z−Y)^2$$, where $$X$$,$$Y$$ and $$Z$$ are independent normal distributions with their own means and variance? The common part is $$Y$$ in both of the summands that introduces correlations, otherwise it is χ2. Thanks for the help!

• How does the histogram look like if you sample, say $10^5$, observations from $X, Y, Z$, compute and plot that expression? Maybe you can guess from that empirical data. Dec 18 '20 at 8:31
• @Xi'an HI, i think the link you provided works only for independent variables, but in my case they are not. Dec 18 '20 at 11:48
• The highly upvoted answer by djs there points out that this is a generalized chi-squared distribution and offers links to literature.
– whuber
Dec 18 '20 at 13:17