Non-central Chi square distribution

PoorBelow averageAverageGoodExcellent (4 votes, average: 3.50 out of 5)

If squares of k independent standard normal random variables are added, it gives rise to central Chi-squared distribution with ‘k’ degrees of freedom. Instead, if squares of k independent normal random variables with non-zero means are added, it gives rise to non-central Chi-squared distribution. Non-central Chi-square distribution is related to Ricean distribution, whereas the central Chi-squared distribution is related to Rayleigh distribution.

The non-central Chi-squared distribution is a generalization of Chi-square distribution. A non-central Chi squared distribution is defined by two parameters: 1) degrees of freedom (k) and 2) non-centrality parameter \lambda.

As we know from previous article, the degrees of freedom specify the number of independent random variables we want to square and sum-up to make the Chi-squared distribution. Non-centrality parameter is the sum of squares of means of the each independent underlying normal random variable.

The non-centrality parameter is given by

\lambda = \displaystyle{\sum_{i=1}^k \mu_i^2} \quad\quad\quad (1)

The PDF f_{\chi_k^2} (x, \lambda) of the non-central Chi-squared distribution having k degrees of freedom and non-centrality parameter \lambda is given by

f_{\chi_k^2} (x, \lambda) = \displaystyle{\sum_{n=0}^{\infty} \frac{e ^{- \lambda/2 } \left(\lambda/2 \right )^n}{n!} f_{Y_{k+2n}} (x)} \quad\quad\quad (2)

Here, the random variable Y_{k+2n} is central Chi-squared distributed with k+2n degrees of freedom. The factor \frac{e ^{- \lambda/2 } \left(\lambda/2 \right )^n}{n!} gives the probabilities of Poisson distribution. Thus, the PDF of the non-central Chi-squared distribution can be termed as the weighted sum of Chi-squared probabilities where the weights being equal to the probabilities of Poisson distribution.

Method of Generating non-central Chi-squared random variable:

The procedure for generating the samples from a non-central Chi-squared random variable is as follows.

● For a given degree of freedom k, let the k normal random variables be X_1,X_2,\cdots,X_k with variances \sigma_1^2,\sigma_2^2,\cdots,\sigma_k^2 and mean \mu_1,\mu_2,\cdots,\mu_k respectively.
● The goal is to add squares of these k independent normal random variables with variances set to one and means satisfying the condition set by equation (1).
● Set \mu_1= \sqrt{\lambda} and \mu_2,\mu_3,\cdots,\mu_k=0
● Generate k-1 standard normal random variables \sim \mathit{N}(\mu=0,\sigma^2=1) and one normal random variable with \mu_1= \sqrt{\lambda} and \sigma_1^2=1
● Squaring and summing-up all the k random variables gives the non-central Chi-squared random variable.
● The PDF of the generated samples can be plotted using the histogram method described here.

Matlab Code:

Check this book for full Matlab code.
Wireless Communication Systems using Matlab – by Mathuranathan Viswanathan

Python Code:

Python numpy package has a nocentral_chisquare() generator, which can be used in a straightforward manner to obtain the non-central Chi square distributed sequences.

#---------Non-central Chi square distribution gaussianwaves.com-----
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
plt.style.use('ggplot')

ks=np.asarray([2,4]) #degrees of freedoms to simulate
ldas = np.asarray([1,2,3]) #non-centrality parameters to simulate
nSamp=1000000 #number of samples to generate

fig, ax = plt.subplots(ncols=1, nrows=1, constrained_layout=True)

for i,k in enumerate(ks):
    for j,lda in enumerate(ldas):
        #Generate non-central Chi-squared distributed random numbers
        X = np.random.noncentral_chisquare(df=k, nonc = lda, size = nSamp)
        ax.hist(X,bins=500,density=True,label=r'$k$={} $\lambda$={}'.format(k,lda),\
        histtype='step',alpha=0.75, linewidth=3)

ax.set_xlim(left=0,right=30);ax.legend()
ax.set_title('PDFs of non-central Chi square distribution');
plt.show()
Simulated PDFs of non-central Chi-Squared random variables
Figure 1: Simulated PDFs of non-central Chi-Squared random variables

Rate this article: PoorBelow averageAverageGoodExcellent (4 votes, average: 3.50 out of 5)

For further reading

[1] David A. Harville, “Linear Models and the Relevant Distributions and Matrix Algebra”, 978-1138578333, Chapman and Hall/CRC, 1 edition, March 2018.↗

Similar topics

Random Variables - Simulating Probabilistic Systems
● Introduction
Plotting the estimated PDF
● Univariate random variables
 □ Uniform random variable
 □ Bernoulli random variable
 □ Binomial random variable
 □ Exponential random variable
 □ Poisson process
 □ Gaussian random variable
 □ Chi-squared random variable
 □ Non-central Chi-Squared random variable
 □ Chi distributed random variable
 □ Rayleigh random variable
 □ Ricean random variable
 □ Nakagami-m distributed random variable
Central limit theorem - a demonstration
● Generating correlated random variables
 □ Generating two sequences of correlated random variables
 □ Generating multiple sequences of correlated random variables using Cholesky decomposition
Generating correlated Gaussian sequences
 □ Spectral factorization method
 □ Auto-Regressive (AR) model

Books by the author

Wireless Communication Systems in Matlab
Wireless Communication Systems in Matlab
Second Edition(PDF)

PoorBelow averageAverageGoodExcellent (180 votes, average: 3.62 out of 5)

Digital modulations using Python
Digital Modulations using Python
(PDF ebook)

PoorBelow averageAverageGoodExcellent (134 votes, average: 3.56 out of 5)

digital_modulations_using_matlab_book_cover
Digital Modulations using Matlab
(PDF ebook)

PoorBelow averageAverageGoodExcellent (136 votes, average: 3.63 out of 5)

Hand-picked Best books on Communication Engineering
Best books on Signal Processing

Post your valuable comments !!!