0

I have some data that are drawn from a Gaussian distribution with mean = 0 and std = 1. I then took each datum and squared it. The histograms below show a Gaussian distribution in black and the new squared data in red:

enter image description here

I am told that the new red distribution is a noncentral chi-squared distribution with 1 degree of freedom (parameter k=1) and parameter $\lambda$ I think should just be the square of the mean of the new red data (which seems to be very close to 1).

Therefore I am plotting a noncentral chi-squared distribution function over my histogram with k = 1 and $\lambda=1$. I did this in python using the scipy.stats.ncx2 package:

enter image description here

As you can see, it doesn't look to quite fit correctly. I wondered if anyone can spot if I am using the incorrect parameters or if there's something else that I'm doing wrong. I tried to vary $\lambda$ a little but that didn't seem to help. Is a noncentral chi-squared distribution the correct one to use?

Sebastiano
  • 7,649
  • 1
    I think you should just be using the ordinary chi-square distribution, not the non-central version. The non-central version is relevant when the normal distribution being sampled from is not centered, i.e., does not have zero mean. As a test, try the cases $\lambda=\mu^2=0,1$. – Semiclassical Jan 30 '23 at 20:39
  • 1
    I was taking the mean of the squared data (~1) but now I see that I should have been using the mean of the normally distributed data (=0). If I change the mean to 0 then the fit is good. – user1551817 Feb 02 '23 at 15:02

0 Answers0