I used Mathematica's function PearsonChiSquareTest to test whether the data were drawn from a normal distribution.

As in the reference, I expected Mathematica to compare the result to a normal distribution, by running: PearsonChiSquareTest[data]. As I wanted to extract the test statistics from properties, I was "forced" to name the distribution I wanted to compare it to, namely the normal distribution: PearsonChiSquareTest[data, NormalDistribution[],"PValue"].
What is surprising is that the PValue for the first case is different from the second case where I use the Normal Distribution explicitly. Anyone knows what's the difference here?

data = RandomVariate[NormalDistribution[], 10^4];


==> 0.3248593157

PearsonChiSquareTest[data, NormalDistribution[]]

==> 0.4704917701

1 Answer 1


According to the documentation you linked, difference is:

  • PearsonChiSquareTest[data, NormalDistribution[]] tests whether the data is distributed according to a normal distribution of mean 0 and standard deviation 1.
  • PearsonChiSquareTest[data] is actually more flexible, and checks whether your data is distributed according to any normal distribution.

The difference becomes flagrant with data from a different distribution:

data = RandomVariate[NormalDistribution[1, 0.1], 10^4];
(* Out[33]= 0.419701 *)

PearsonChiSquareTest[data, NormalDistribution[]]
(* Out[34]= 2.712072730217051*10^-23123 *)

In short, the following two statements are equivalent:

PearsonChiSquareTest[data, NormalDistribution[μ, Σ]]

where the second one uses symbolic parameters in the distribution. You can retrieve information about the test by doing:

PearsonChiSquareTest[data, NormalDistribution[μ, Σ], "HypothesisTestData"]

and exploring the different properties of this object. All properties can be listed by:

PearsonChiSquareTest[data, NormalDistribution[μ, Σ], "HypothesisTestData"]["Properties"]

and the fitted distribution is recovered with:

PearsonChiSquareTest[data, NormalDistribution[μ, Σ], "HypothesisTestData"]["FittedDistribution"]


  • $\begingroup$ and: in the example given in the question, there is more evidence to reject the H0 "any normal dist" than H0 N(0,1)? this seems a little counter intuitive... $\endgroup$ Apr 15, 2012 at 19:18
  • $\begingroup$ @PeriodicProgrammer I suppose that the test statistic includes the fact that by optimizing the fit parameters you are capitalizing on chance. So I guess p will be adjusted. BTW if you -re-run the example you can see the rank order of the p values may differ from run to run. $\endgroup$ Apr 15, 2012 at 20:05
  • 2
    $\begingroup$ @F'x Nice close reading of the docs. It is easy to interpret "tests whether data is normally distributed" as "tests whether data is distributed as N(0,1)". The docs could have been somewhat more explicit here. $\endgroup$ Apr 15, 2012 at 20:09
  • $\begingroup$ thank you for your detailed and very helpful answer! I was unaware while conducting the tests, that while using NormDist[] it does directly use N(0,1), even though in retrospect it seems somehow logical :P. $\endgroup$ Apr 15, 2012 at 20:12

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.