20
$\begingroup$

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)?

$\endgroup$
1

3 Answers 3

15
$\begingroup$

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$.

$\endgroup$
3
  • 1
    $\begingroup$ 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? $\endgroup$
    – Thomas
    Mar 13, 2016 at 19:44
  • $\begingroup$ Just made an edit to address this. $\endgroup$ Mar 13, 2016 at 20:12
  • 1
    $\begingroup$ 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) $\endgroup$
    – Thomas
    Mar 14, 2016 at 9:31
2
$\begingroup$

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');

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

enter image description here

$\endgroup$
0
$\begingroup$

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');

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

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ Welcome to the site. Please don't post tentative answers and ask for feedback. Cross Validated is strictly a Q&A site, not a discussion forum. If you want to ask about your understanding of something, please post it as a new question. Since you're new here, you may want to take our tour, which has information for new users. $\endgroup$ Oct 10, 2023 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.