Solve the following problem:
The noncentral chi-squared distribution,X2p(λ) can be defined by
(i). a mixture representation (2.2), where g(x|y) is the density of and p(y) is the density X2p+2 of P(λ/2), and
(ii). the sum of a X2p-1 random variable and the square of a N (||θ||, 1).
a. Show that both those representations hold.
b. Show that the representations are equivalent if λ = θ2/2.
c. Compare the corresponding algorithms that can be derived from these representations among themselves and also with rchisq for small and large values of λ.