I have a list of data: data
I want to find the best fit distribution curve and then fit curve. After finding the fitting distribution, I want to compute the Pearson chi-square to test the fitting goodness.
I wrote the following code:
data = Flatten[
Table[Import["IMGareacell_" <> ToString[i] <> ".csv", "Data"], {i,
5}]];
edist = EstimatedDistribution[data,
ParetoDistribution[k, \[Alpha], \[Gamma], \[Mu]]]
\[ScriptCapitalH] =
DistributionFitTest[data, edist, "HypothesisTestData"]
\[ScriptCapitalH]["TestDataTable", All]
Show[Histogram[data, {2, 20, 0.4}, "PDF"],
Plot[PDF[TruncatedDistribution[{2, 20}, edist], x], {x, 2, 20},
PlotStyle -> Thick, PlotRange -> {0, 2}]]
The fitting curve seems very close to the histogram, however the p value in the testtable is extramely small. I am new to mathematica and really want to know why and slove the problem.
Thank you