# Chi-Squared Distribution

A random variable is always associated with a probability distribution. When the random variable undergoes mathematical transformation the underlying probability distribution no longer remains the same. Consider a random variable Z whose probability distribution function (PDF) is a standard normal distribution (mean=0 and variance=1). Now, if the random variable is squared (a mathematical transformation), then the PDF of Z

^{2}is no longer a standard normal distribution. The new transformed distribution is called Chi-Squared Distribution with 1 degree of freedom. The PDF of Z and Z

^{2}are plotted in Figure 1.

The mean of the random variable Z is E(Z) = 0 and for the transformed variable Z^{2}, the mean is given by E(Z^{2})=1. Similarly, the variance of the random variable Z is var(Z)=1, whereas the variance of the transformed random variable Z^{2} is var(Z^{2})=2. In addition to the mean and variance, the shape of the distribution is also changed. The distribution of the transformed variable Z^{2} is no longer symmetric. In fact, the distribution is skewed to one side. Also the random variable Z^{2} can take only positive values whereas the random variable Z can take negative values too (note the x-axis in the plots above).

Since the new transformation is based on only one parameter (Z), the degree of freedom for this transformation is 1. Therefore, the transformed random variable Z^{2} follows – “Chi-squared distribution with 1 degree of freedom”.

Suppose, if Z_{1},Z_{2}, …,Z_{k} are independent random variables that follows standard normal distribution(mean=0,variance= 1), then the transformation,

is a Chi-squared distribution with k degrees of freedom. The following figure illustrates how the definition of the Chi-squared distribution as a transformation of normal distribution for 1 degree of freedom and 2 degrees of freedom. In the same manner, the transformation can be extended to ‘k’ degrees of freedom.

The above equation is derived from k random variables that follow standard normal distribution. For a standard normal distribution, the mean=0. Therefore, the transformation is called “central” Chi-square distribution. If, the underlying ‘k’ random variables follow normal distribution with non-zero mean, then the transformation is called “non-central” Chi-square distribution. In channel modeling, the central Chi-square distribution is related to Rayleigh Fading scenario and the non-central Chi-square distribution is related to Rician Fading scenario.

Mathematically, the PDF of the central Chi-squared distribution with ‘k’ degrees of freedom is given by

The mean and variance of the central Chi-squared distributed andom variable is given by

## Applications:

Chi-squared distribution is used in hypothesis testing (to compare the observed data with expected data that follows a specific hypothesis) and in estimating variances of a parameter. It is related to Rayleigh distribution.

## Matlab Simulation:

The following Matlab code is used to simulated central Chi-squared distributed variables with degrees of freedom = 1,2,3,4 and 5. Finally the PDFs of the simulated variables are plotted.

Check this book for full Matlab code.

Simulation of Digital Communication Systems Using Matlab – by Mathuranathan Viswanathan

## See Also:

[1] Introduction to Random Variables, PDF and CDF

[2] Non-central Chi-squared distribution and its simulation in Matlab

[3] Uniform Random Variables and Uniform Distribution

[4] Derivation of Error Rate Performance of an optimum BPSK receiver in AWGN channel

[5] Eb/N0 Vs BER for BPSK over Rician Fading Channel

[6] BER Vs Eb/N0 for QPSK modulation over AWGN

[7] BER Vs Eb/N0 for 8-PSK modulation over AWGN

[8] Simulation of M-PSK modulation techniques in AWGN channel

[9] Performance comparison of Digital Modulation techniques

## External Links:

[1] Chi-Square Test Penn State University

[2] Java Applet – Chi Square goodness of Fit test – created by David Eck and modified by Jim Ryan – Mathbeans project

[3] Chi-Square Test for variance ,e-handbook of statistical methods,National Institute of Standards and Technology

[4] [4] Dr. Claude Moore,Estimation of Variance,Cape Fear Community College

Pingback: Fading channels – Rayleigh Fading | GaussianWaves()

Pingback: Eb/N0 Vs BER for BPSK over Rician Fading Channel | GaussianWaves()

Pingback: Non-central Chi-squared Distribution | GaussianWaves()

Pingback: Uniform Random Variables and Uniform Distribution | GaussianWaves()

Pingback: Simulation of Rayleigh Fading ( Clarke’s Model – sum of sinusoids method) | GaussianWaves()