I'd like to use Matlab to generate random matrices from the complex Wishart distribution with $n$ degrees of freedom.
The wishrnd function in Matlab only generates real Wishart matrices.
What I do now is I generate $n$ random vectors $\mathbf{x}_{i} \sim \mathcal{CN}(\mathbf{0},\mathbf{\Sigma})$, $i=1, \ldots, n$, and then obtain the complex Wishart random matrix as
$$\mathbf{X} = \sum_{i=1}^{n} \mathbf{x}_{i} \mathbf{x}_{i}^{\mathrm{H}}.$$
Is there a way to obtain $\mathbf{X}$ without the above expression?
Observe that, if I generate two Wishart random matrices $\mathbf{A}$ and $\mathbf{B}$ using the wishrnd function, $\mathbf{X} = \mathbf{A} + i \mathbf{B}$ does not follow the complex Wishart distribution (since we should have $\mathbb{E}[\mathbf{X}] = \mathbf{I})$.
If you take a look at the
wishrnd.mfunction's code, you'll see a couple of things.The first is that if the degrees of freedom are less than somewhere around 81 or so, then the method that you described is exactly the method that is used to generate the Wishart. The only thing that needs to change in the code is that instead of
x = (randn(df,size(d,1))*d;you should be using something like
x = (randn(df,size(d,1)) + 1i*randn(df,size(d,1)))/sqrt(2) * d;to generate the complex normal draws.
The second method is based on the Bartlett decomposition, and the code specifies a reference of Smith and Hocking (which I frankly never found). An
xsimilar to that used in the real-valued code can be built, but because of the complex nature of the covariance structure, the diagonal elements are not $\chi^2$-variables, but rather Generalized Gamma distributed (see for example Nagar & Gupta, 2011).If you'd like to use this method (i.e. you need degrees of freedom much greater than 80), then in the code, substitute in for
aa correctly sized diagonal matrix whose elements are drawn from the generalized gamma distribution as described in the paper, and away you go!Nagar, Daya K.; Gupta, Arjun K., Expectations of functions of complex Wishart matrix, Acta Appl. Math. 113, No. 3, 265-288 (2011). ZBL1207.62114.