# Distribution of the square of a non-standard normal random variable

What is the distribution of the square of a non-standard normal random variable (i.e., the mean is not equal to 0 and the variance is not equal to 1)?

It is a scaled non-central chi-square distribution with one degree of freedom. More specifically, if $Z$ is a normal random variable with mean $\mu$ and variance $\sigma^2$, then $\frac{Z^2}{\sigma^2}$ is a non-central chi-square random variable with one degree of freedom and non-centrality parameter $\lambda=\left(\frac{\mu}{\sigma}\right)^2$.

• The non-centrality parameter in the non-central chi square is the square of the mean of the normal distribution in question. What is the scaling factor that we multiply the non-central chi square by to account for the variance of the normal distribution not being equal to 1? Mar 13, 2016 at 19:44
• Just made an edit to address this. Mar 13, 2016 at 20:12
• To make it even more concrete for those of us who like concrete, to generate m random values of Z squared, in R you can use Z2 <- s^2 * rchisq(m,df=1,ncp=(mu/s)^2) Mar 14, 2016 at 9:31

A noncentral $$\chi^2$$ distribution, applies only to a normal variable with unit variance. In such case, the square of random variable $$X_1\sim N(x|\mu, 1)$$ is noncentral $$\chi^2$$ distributed with degrees of freedom $$k=1$$ and noncentrality parameter $$\lambda=\mu^2$$: $$X_1^2=Z\sim \chi^2(z_1|k, \lambda).$$

However, one can establish a relationship between a normally distributed variable $$X_2 \sim N(x_2|\mu,\sigma)$$ and noncentral $$Z_2 \sim \chi^2(z_2|1,\tfrac{\mu^2}{\sigma^2})$$ distributed variable as such: $$X_2^2=Z\sigma^2$$

Proof by example:

mu = 10;     % Mean of the normal

distribution
sigma = 2;  % Standard deviation of the normal distribution
num_samples = 1000000; % Number of samples

% Generate normal random variables with specified mean and standard deviation
X = normrnd(mu, sigma, num_samples, 1);

% Compute the squares
X_squared = (X).^2;

% Compute non-centrality parameter
lambda = (mu/sigma)^2;

% Generate samples from non-central chi-squared distribution
Y = ncx2rnd(1, lambda, num_samples, 1);

% Plot histograms
figure; hold on;
histogram(X_squared, 'Normalization', 'pdf', 'BinWidth', 0.1, 'FaceColor', 'r', 'FaceAlpha', 0.5, 'EdgeColor','none');
histogram(Y*sigma^2,         'Normalization', 'pdf', 'BinWidth', 0.1, 'FaceColor', 'b', 'FaceAlpha', 0.5, 'EdgeColor','none');
xlabel('Value');
ylabel('Probability Density');

legend('X^2', '\chi^2');


Here is Matlab code showing that the answer by Brent Kerby is not true.

mu = 10;     % Mean of the normal distribution
sigma = 2;  % Standard deviation of the normal distribution
num_samples = 1000000; % Number of samples

% Generate normal random variables with specified mean and standard deviation
X = normrnd(mu, sigma, num_samples, 1);

% Compute the squares
X_squared = X.^2;

% Compute non-centrality parameter
lambda = (mu/sigma)^2;

% Generate samples from non-central chi-squared distribution
Y = ncx2rnd(1, lambda, num_samples, 1);

% Plot histograms
figure; hold on;
histogram(X_squared, 'Normalization', 'pdf', 'BinWidth', 0.1, 'FaceColor', 'r', 'FaceAlpha', 0.5, 'EdgeColor','none');
histogram(Y,         'Normalization', 'pdf', 'BinWidth', 0.1, 'FaceColor', 'b', 'FaceAlpha', 0.5, 'EdgeColor','none');
xlabel('Value');
ylabel('Probability Density');